diff --git a/spec/datadog/di/integration/instrumentation_spec.rb b/spec/datadog/di/integration/instrumentation_spec.rb index 15b6168e5f6..d561a1cfd00 100644 --- a/spec/datadog/di/integration/instrumentation_spec.rb +++ b/spec/datadog/di/integration/instrumentation_spec.rb @@ -545,10 +545,17 @@ def run_test expect(snapshot.fetch(:message)).to match(/\Ahello (\d+\.\d+) ms\z/) snapshot.fetch(:message) =~ /\Ahello (\d+\.\d+) ms\z/ value = Float($1) - # Actual execution time will change but it should be under - # a second and it should be positive. + # Actual execution time varies greatly in CI. + # A method that returns an integer will ordinarily report a + # duration on the order of 1 millisecond. + # However, one time the duration reported was exactly zero. + # After the test method was made longer to definitely take + # a non-zero amount of time to execute, on one CI run it took + # 1.8 seconds. + # Therefore, the current brackets are strictly greater than + # zero seconds and under 4 seconds. expect(value).to be > 0 - expect(value).to be < 1 + expect(value).to be < 4 end expect(InstrumentationSpecTestClass.new.long_test_method).to eq(42) component.probe_notifier_worker.flush