Commit 86ed7ca
Fix JMS1 CLIENT_ACKNOWLEDGE flaky test by tolerating early scope cleanup
The "receiving messages from TEMPORARY_TOPIC with manual acknowledgement"
test in JMS1V1ForkedTest was flaky because the scope iteration keep-alive
cleanup (set to 1 second in tests) could finish the 3rd consumer span
before acknowledge() was called, producing 6 traces instead of expected 5.
Root cause: In the legacy context manager path, activateNext() schedules a
root iteration scope cleanup. If this fires before the test's intermediate
assertTraces(5) check, the 3rd consumer trace is already complete.
Fix: Use assertTraces(5, true) for the intermediate assertion to tolerate
additional traces. Also fix ListWriterAssert.ignoreAdditionalTraces to
properly use >= instead of == for the size check, matching the behavior
of the Java TraceAssertions class.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 3f32873 commit 86ed7ca
File tree
2 files changed
+9
-5
lines changed- dd-java-agent
- instrumentation/jms/javax-jms-1.1/src/test/groovy
- testing/src/main/groovy/datadog/trace/agent/test/asserts
2 files changed
+9
-5
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
256 | 255 | | |
257 | 256 | | |
258 | 257 | | |
259 | | - | |
260 | 258 | | |
261 | 259 | | |
262 | 260 | | |
| |||
278 | 276 | | |
279 | 277 | | |
280 | 278 | | |
281 | | - | |
282 | | - | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
0 commit comments