Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions spec/datadog/di/integration/instrumentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down