Commit d7c142f
Fix thread-safety bug in TestSpanHandler causing flaky tracing tests (#2971)
* Increase Awaitility timeout in tracing tests from 5s to 10s
The 5-second timeout introduced in #2962 is still not sufficient for
CI environments under load. Tracing tests like
testThatNewSpanIsCreatedOnClientTimeout continue to fail with
ConditionTimeoutException at the 5-second mark. Increase all Awaitility
timeouts to 10 seconds across all tracing test files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Increase Awaitility timeout in tracing tests from 10s to 30s
Even the 10s timeout was observed failing in CI (run 23065827441).
Analysis of recent builds shows the 5s ConditionTimeoutException
occurs in virtually every CI run. Use 30s to provide sufficient
headroom for loaded CI environments while still catching genuine
hangs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* Fix TestSpanHandler thread-safety and revert timeout increase
TestSpanHandler.SPANS used a plain ArrayList, which is not
thread-safe. Client and server spans are added from different
threads, so concurrent ArrayList.add() calls can lose elements
and size() may return stale values due to JMM visibility.
Change to CopyOnWriteArrayList which provides proper thread-safety.
Writes (span additions) are infrequent while reads (Awaitility
polling) are frequent, making COW the ideal choice.
Revert the Awaitility timeout back to 5s since the thread-safety
fix addresses the root cause of the flaky failures.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit e6ce6d6)1 parent 9a756ed commit d7c142f
1 file changed
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments