Commit a7cf43d
committed
Fix KafkaMLCTests for proper CountDownLatch place
In the `KafkaMessageListenerContainerTests.invokeBatchInterceptorSuccessFailureOnRetry()`
we are expecting interaction with a `BatchInterceptor`, when its `success` or `failure` happens
already after the `MessageListener` call, but a `CountDownLatch` thread barrier in the test setup
is counted in the `MessageListener` leading to race condition when we exit from the barrier to
verification phase, but `BatchInterceptor.success()` has not been called yet
in the other thread.
* Fix `KafkaMessageListenerContainerTests.invokeBatchInterceptorSuccessFailureOnRetry()`
moving `CountDownLatch` to the `BatchInterceptor.success()` implementation.
Leave `MessageListener` just only with an `AtomicInteger` for retry attempts1 parent 5d5291f commit a7cf43d
File tree
1 file changed
+12
-4
lines changed- spring-kafka/src/test/java/org/springframework/kafka/listener
1 file changed
+12
-4
lines changedLines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4313 | 4313 | | |
4314 | 4314 | | |
4315 | 4315 | | |
4316 | | - | |
| 4316 | + | |
| 4317 | + | |
4317 | 4318 | | |
4318 | 4319 | | |
4319 | 4320 | | |
4320 | 4321 | | |
4321 | 4322 | | |
4322 | | - | |
4323 | | - | |
| 4323 | + | |
4324 | 4324 | | |
4325 | 4325 | | |
4326 | 4326 | | |
| |||
4334 | 4334 | | |
4335 | 4335 | | |
4336 | 4336 | | |
| 4337 | + | |
| 4338 | + | |
4337 | 4339 | | |
4338 | 4340 | | |
4339 | 4341 | | |
| |||
4342 | 4344 | | |
4343 | 4345 | | |
4344 | 4346 | | |
| 4347 | + | |
| 4348 | + | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
4345 | 4352 | | |
4346 | 4353 | | |
4347 | 4354 | | |
4348 | 4355 | | |
4349 | 4356 | | |
4350 | 4357 | | |
4351 | 4358 | | |
4352 | | - | |
| 4359 | + | |
| 4360 | + | |
4353 | 4361 | | |
4354 | 4362 | | |
4355 | 4363 | | |
| |||
0 commit comments