Commit 12bd1f0
CAMEL-24063: Revert Awaitility-based DirectProducerBlockingTest to race-tolerant design
The Awaitility-based TIMED_WAITING approach (introduced in CAMEL-19549,
Jun 25/29) imposed a strict thread-ordering dependency that introduced
flakiness where the original code had none (stable for 6 years).
Replace with ScheduledExecutorService.schedule() — same 200ms delay
semantics as the original Thread.sleep(200), without using Thread.sleep:
- If resume fires before sendBody starts blocking: route is already
resumed, sendBody finds the consumer immediately (pass)
- If resume fires while sendBody is blocking: sendBody gets unblocked
(pass)
Both race outcomes produce a passing test. Restore timeout=1000 (800ms
of headroom is plenty).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 9b0dfb1 commit 12bd1f0
1 file changed
Lines changed: 17 additions & 28 deletions
File tree
- core/camel-core/src/test/java/org/apache/camel/component/direct
Lines changed: 17 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
74 | 73 | | |
75 | 74 | | |
76 | 75 | | |
77 | | - | |
78 | | - | |
79 | 76 | | |
80 | 77 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
100 | 90 | | |
101 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
102 | 94 | | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 95 | + | |
107 | 96 | | |
108 | 97 | | |
109 | 98 | | |
| |||
0 commit comments