Skip to content

Fix flaky /spec/models/ci_platform_metric_spec.rb

Albert Salim requested to merge caalberts-fix-flaky-ci_platform_metric_spec into master

What does this MR do?

Fixes flaky test that failed with the following:

Failures:

  1) CiPlatformMetric .insert_auto_devops_platform_targets! when there is already existing metrics data does not erase any existing data
     Failure/Error: let!(:metric_1) { create(:ci_platform_metric) }

     ActiveRecord::RecordInvalid:
       Validation failed: Count must be greater than 0
     # ./spec/models/ci_platform_metric_spec.rb:36:in `block (6 levels) in <main>'
     # ./spec/spec_helper.rb:326:in `block (3 levels) in <main>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:317:in `block (2 levels) in <main>'
     # ./spec/spec_helper.rb:313:in `block (3 levels) in <main>'
     # ./spec/spec_helper.rb:313:in `block (2 levels) in <main>'
     # -e:1:in `<main>'
Edited by Albert Salim

Merge request reports

Loading