Skip to content

Commit

Permalink
Fix TestOOMError#testOOMCMLC race condition
Browse files Browse the repository at this point in the history
Fixes: #3059 

* Fix TestOOMError#testOOMCMLC throw ConcurrentModificationException due to a race condition in test

**Auto-cherry-pick to `3.1.x`**
  • Loading branch information
Wzy19930507 authored Feb 22, 2024
1 parent cfa369b commit 562769d
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018-2022 the original author or authors.
* Copyright 2018-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -77,7 +77,8 @@ public void testOOMCMLC() throws Exception {
containerProps.setClientId("clientId");
ConcurrentMessageListenerContainer<Integer, String> container =
new ConcurrentMessageListenerContainer<>(cf, containerProps);
CountDownLatch stopLatch = new CountDownLatch(1);
// concurrent container publishes one time, child container publishes concurrency time.
CountDownLatch stopLatch = new CountDownLatch(2);
container.setApplicationEventPublisher(e -> {
if (e instanceof ContainerStoppedEvent) {
stopLatch.countDown();
Expand Down

0 comments on commit 562769d

Please sign in to comment.