Skip to content
This repository has been archived by the owner on Oct 1, 2019. It is now read-only.

Commit

Permalink
add more wiggle room to harvest slowest, since it still fails intermi…
Browse files Browse the repository at this point in the history
…ttently.
  • Loading branch information
jaggederest committed May 9, 2011
1 parent 3246e82 commit 7c74129
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/new_relic/agent/transaction_sampler_test.rb
Expand Up @@ -740,7 +740,7 @@ def test_harvest_slowest
run_sample_trace

slowest = @sampler.harvest(nil, 0)[0]
assert((slowest.duration >= 0.1), "expected sample duration >= 0.1, but was: #{slowest.duration.inspect}")
assert((slowest.duration >= 0.09), "expected sample duration >= 0.09, but was: #{slowest.duration.inspect}")
# this assert is here to make sure the test remains valid
assert((slowest.duration <= 0.15), "expected sample duration <= 0.15, but was: #{slowest.duration.inspect}")

Expand All @@ -749,7 +749,7 @@ def test_harvest_slowest
not_as_slow = @sampler.harvest(slowest, 0)[0]
assert((not_as_slow == slowest), "Should re-harvest the same transaction since it should be slower than the new transaction - expected #{slowest.inspect} but got #{not_as_slow.inspect}")

run_sample_trace { sleep 0.15 }
run_sample_trace { sleep 0.16 }
new_slowest = @sampler.harvest(slowest, 0)[0]
assert((new_slowest != slowest), "Should not harvest the same trace since the new one should be slower")
assert((new_slowest.duration >= 0.15), "Slowest duration must be >= 0.15, but was: #{new_slowest.duration.inspect}")
Expand Down

0 comments on commit 7c74129

Please sign in to comment.