Commit cf1cff8
SourcePollingChannelAdapterErrorObservationTests: race condition
The `try-with-resource` on the `ApplicationContext` may stop this context
before the message is handled as expected in the flow logic.
The timing race condition is due to a scheduling nature of the `SourcePollingChannelAdapter`
Fix the `SourcePollingChannelAdapterErrorObservationTests` with a `CountDownLatch`
to wait in the `try-with-resource` block until it is fulfilled in the `afterSendCompletion()`
of the `ChannelInterceptor` on the `errorChannel`
(cherry picked from commit d60fc95)1 parent fbc70b1 commit cf1cff8
File tree
1 file changed
+21
-1
lines changed- spring-integration-core/src/test/java/org/springframework/integration/support/management/observation
1 file changed
+21
-1
lines changedLines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
| 68 | + | |
| 69 | + | |
62 | 70 | | |
63 | 71 | | |
64 | 72 | | |
| |||
93 | 101 | | |
94 | 102 | | |
95 | 103 | | |
| 104 | + | |
| 105 | + | |
96 | 106 | | |
97 | 107 | | |
98 | 108 | | |
| |||
115 | 125 | | |
116 | 126 | | |
117 | 127 | | |
118 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
119 | 139 | | |
120 | 140 | | |
121 | 141 | | |
| |||
0 commit comments