|
52 | 52 | expect(second_span[:description]).to eq("SELECT \"posts\".* FROM \"posts\"") |
53 | 53 | expect(second_span[:parent_span_id]).to eq(first_span[:span_id]) |
54 | 54 |
|
55 | | - # this is to make sure we calculate the timestamp in the correct scale (second instead of millisecond) |
56 | | - # Use more relaxed bounds for JRuby compatibility |
57 | | - min_duration = 10.0 / 1_000_000 # 10 microseconds |
58 | | - max_duration = RUBY_PLATFORM == "java" ? 50.0 / 1000 : 10.0 / 1000 # 50ms for JRuby, 10ms for others |
59 | | - expect(second_span[:timestamp] - second_span[:start_timestamp]).to be_between(min_duration, max_duration) |
| 55 | + expect(second_span[:timestamp] - second_span[:start_timestamp]).to be > 0 |
| 56 | + expect(second_span[:start_timestamp]).to be >= transaction[:start_timestamp] |
| 57 | + expect(second_span[:timestamp]).to be <= transaction[:timestamp] |
60 | 58 | end |
61 | 59 |
|
62 | 60 | it "records transaction alone" do |
|
91 | 89 | ) |
92 | 90 | expect(second_span[:parent_span_id]).to eq(first_span[:span_id]) |
93 | 91 |
|
94 | | - # this is to make sure we calculate the timestamp in the correct scale (second instead of millisecond) |
95 | | - # Use more relaxed bounds for JRuby compatibility |
96 | | - min_duration = 10.0 / 1_000_000 # 10 microseconds |
97 | | - max_duration = RUBY_PLATFORM == "java" ? 50.0 / 1000 : 10.0 / 1000 # 50ms for JRuby, 10ms for others |
98 | | - expect(second_span[:timestamp] - second_span[:start_timestamp]).to be_between(min_duration, max_duration) |
| 92 | + expect(second_span[:timestamp] - second_span[:start_timestamp]).to be > 0 |
| 93 | + expect(second_span[:start_timestamp]).to be >= transaction[:start_timestamp] |
| 94 | + expect(second_span[:timestamp]).to be <= transaction[:timestamp] |
99 | 95 |
|
100 | 96 | third_span = transaction[:spans][2] |
101 | 97 | expect(third_span[:op]).to eq("template.render_template.action_view") |
|
0 commit comments