Skip to content

Commit be6ea37

Browse files
Wzy19930507spring-builds
authored andcommitted
Fix TestOOMError#testOOMCMLC race condition
Fixes: #3059 * Fix TestOOMError#testOOMCMLC throw ConcurrentModificationException due to a race condition in test (cherry picked from commit 562769d)
1 parent 5b63191 commit be6ea37

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-kafka/src/test/java/org/springframework/kafka/listener/TestOOMError.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2018-2022 the original author or authors.
2+
* Copyright 2018-2024 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -77,7 +77,8 @@ public void testOOMCMLC() throws Exception {
7777
containerProps.setClientId("clientId");
7878
ConcurrentMessageListenerContainer<Integer, String> container =
7979
new ConcurrentMessageListenerContainer<>(cf, containerProps);
80-
CountDownLatch stopLatch = new CountDownLatch(1);
80+
// concurrent container publishes one time, child container publishes concurrency time.
81+
CountDownLatch stopLatch = new CountDownLatch(2);
8182
container.setApplicationEventPublisher(e -> {
8283
if (e instanceof ContainerStoppedEvent) {
8384
stopLatch.countDown();

0 commit comments

Comments
 (0)