Failure in ee/spec/services/software_license_policies/bulk_create_scan_result_policy_service_spec.rb
Add those labels
Summary
Steps to reproduce
Please refer to Flaky tests documentation to learn more about how to reproduce them.
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.
Logs
Job #6188571875 failed for c04b40d4:
And also job #6186011541.
Failures:
1) SoftwareLicensePolicies::BulkCreateScanResultPolicyService#execute when valid parameters are specified creates one software license policy correctly
Failure/Error: created_policy = SoftwareLicensePolicy.find_by(result[:software_license_policy].first)
NoMethodError:
undefined method `first' for nil:NilClass
# ./ee/spec/services/software_license_policies/bulk_create_scan_result_policy_service_spec.rb:26:in `block (4 levels) in <main>'
# ./spec/spec_helper.rb:440:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:431:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:427:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:68:in `with_raw_context'
# ./spec/spec_helper.rb:427:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:275:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
2) SoftwareLicensePolicies::BulkCreateScanResultPolicyService#execute when valid parameters are specified when name contains whitespaces creates one software license policy with stripped name
Failure/Error: created_policy = SoftwareLicensePolicy.find_by(result[:software_license_policy].first)
NoMethodError:
undefined method `first' for nil:NilClass
# ./ee/spec/services/software_license_policies/bulk_create_scan_result_policy_service_spec.rb:58:in `block (5 levels) in <main>'
# ./spec/spec_helper.rb:440:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:431:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:427:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:68:in `with_raw_context'
# ./spec/spec_helper.rb:427:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:275:in `block (2 levels) in <top (required)>'
# ./spec/support/system_exit_detected.rb:7:in `block (2 levels) in <main>'
# ./spec/support/fast_quarantine.rb:22:in `block (2 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (3 levels) in <main>'
# ./spec/support/database/prevent_cross_joins.rb:60:in `with_cross_joins_prevented'
# ./spec/support/database/prevent_cross_joins.rb:106:in `block (2 levels) in <main>'
Finished in 5.64 seconds (files took 43.45 seconds to load)
2 examples, 2 failures
Failed examples:
rspec ./ee/spec/services/software_license_policies/bulk_create_scan_result_policy_service_spec.rb:24 # SoftwareLicensePolicies::BulkCreateScanResultPolicyService#execute when valid parameters are specified creates one software license policy correctly
rspec ./ee/spec/services/software_license_policies/bulk_create_scan_result_policy_service_spec.rb:56 # SoftwareLicensePolicies::BulkCreateScanResultPolicyService#execute when valid parameters are specified when name contains whitespaces creates one software license policy with stripped name
Randomized with seed 18991
Edited by Luke Duncalfe