Flaky spec: rspec ./spec/lib/gitlab/ci/templates/5_minute_production_app_ci_yaml_spec.rb:43 # 5-Minute-Production-App.gitlab-ci.yml the created pipeline when AWS variables are set pipeline branch is protected does not create a destroy job
Related incident gitlab-org/quality/engineering-productivity/master-broken-incidents#704 (closed)
Job failing 3678825107
Summary
Steps to reproduce
Failures:
1) 5-Minute-Production-App.gitlab-ci.yml the created pipeline when AWS variables are set pipeline branch is protected does not create a destroy job
Failure/Error: expect(build_names).to match_array(%w(build terraform_apply deploy))
expected collection contained: ["build", "deploy", "terraform_apply"]
actual collection contained: ["build", "deploy", "terraform_apply", "terraform_destroy"]
the extra elements were: ["terraform_destroy"]
# ./spec/lib/gitlab/ci/templates/5_minute_production_app_ci_yaml_spec.rb:44:in `block (5 levels) in <main>'
# ./spec/spec_helper.rb:511:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:18:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:503:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:499:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:59:in `with_raw_context'
# ./spec/spec_helper.rb:499:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:239:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/flaky_tests.rb:27:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:108:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:62:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:108:in `block (2 levels) in <main>'
Finished in 1 minute 7.09 seconds (files took 47.74 seconds to load)
86 examples, 1 failure
Failed examples:
rspec ./spec/lib/gitlab/ci/templates/5_minute_production_app_ci_yaml_spec.rb:43 # 5-Minute-Production-App.gitlab-ci.yml the created pipeline when AWS variables are set pipeline branch is protected does not create a destroy job
Randomized with seed 41042
[TEST PROF INFO] Time spent in factories: 00:16.299 (23.31% of total time)
Proposed Resolution
Please refer to the Resolution guidance to learn more about resolution of broken master.
Once the flaky failure has been fixed on the default branch, open merge requests to cherry-pick the fix to the active stable branches.
Job #3678825107 failed for 9aa0d34b:
Root cause
Order dependency and memoized instance variable on let_it_be(:project)
variable.
See #389771 (comment 1259287372)
See !106532 (diffs)
Solution
Use let_it_be_with_refind(:project)
.
Edited by Peter Leitzen