Skip to content

Commit 047c8f3

Browse files
committed
Increase poll timeout in MessageGroupQueueTests
`100` milliseconds is not enough for all the environments to achieve a proper async barrier
1 parent 79870dc commit 047c8f3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

spring-integration-core/src/test/java/org/springframework/integration/store/MessageGroupQueueTests.java

+5-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import org.apache.commons.logging.Log;
3030
import org.apache.commons.logging.LogFactory;
31-
import org.junit.Test;
31+
import org.junit.jupiter.api.Test;
3232

3333
import org.springframework.messaging.Message;
3434
import org.springframework.messaging.support.GenericMessage;
@@ -40,6 +40,8 @@
4040
/**
4141
* @author Dave Syer
4242
* @author Gary Russell
43+
* @author Artem Bilan
44+
*
4345
* @since 2.0
4446
*/
4547
public class MessageGroupQueueTests {
@@ -74,7 +76,7 @@ public void testPollEmpty() throws Exception {
7476
CountDownLatch latch2 = new CountDownLatch(1);
7577
exec.execute(() -> {
7678
try {
77-
Message<?> result = queue.poll(100, TimeUnit.MILLISECONDS);
79+
Message<?> result = queue.poll(10, TimeUnit.SECONDS);
7880
if (result != null) {
7981
latch2.countDown();
8082
}
@@ -92,7 +94,7 @@ public void testPollEmpty() throws Exception {
9294
@Test
9395
public void testSize() throws Exception {
9496
MessageGroupQueue queue = new MessageGroupQueue(new SimpleMessageStore(), "FOO");
95-
queue.put(new GenericMessage<String>("foo"));
97+
queue.put(new GenericMessage<>("foo"));
9698
assertThat(queue.size()).isEqualTo(1);
9799
queue.poll(100, TimeUnit.MILLISECONDS);
98100
assertThat(queue.size()).isEqualTo(0);

0 commit comments

Comments
 (0)