Skip to content

Retry scan policy mutation if it fails in test due to race condition

Mark Lapierre requested to merge ml-retry-on-scan-policy-mutation-error into master

What does this MR do and why?

If we try to create a scan execution policy before project authorization is updated the mutation fails. See #413667 (closed)

In this MR we wait 5 seconds for project authorization to complete and then try again. We re-raise the mutation failure error after 3 attempts.

This should also fix #414503 (closed)

How to set up and validate locally

From the qa directory:

bundle install
export WEBDRIVER_HEADLESS=false # If you'd like to watch the test in action
export QA_GITLAB_URL="http://gdk.test:3000" # Only needed if GDK is not running on http://127.0.0.1:3000
bundle exec rspec qa/specs/features/ee/browser_ui/10_govern/scan_result_policy_vulnerabilities_spec.rb

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Mark Lapierre

Merge request reports

Loading