From 3081c4ac651d622c087f861e6ef5875d78eb0572 Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Thu, 16 Oct 2014 12:27:09 +0300 Subject: [PATCH] Increase `receive` timeout for some tests https://build.spring.io/browse/INT-B41-118 Since `send` to the `discardChannel` caused from the separate Thread (`TaskScheduler` from `groupTimeout`) there is some time window when receiving thread wait on `queue` lock, so `0` timeout to wait isn't enough --- .../integration/aggregator/ResequencerTests.java | 6 +++--- .../MessagingAnnotationsWithBeanAnnotationTests.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java index 93a790653b..5b23ca2261 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/aggregator/ResequencerTests.java @@ -340,11 +340,11 @@ public class ResequencerTests { Message message2 = createMessage("456", "ABC", 3, 2, null); this.resequencer.handleMessage(message3); this.resequencer.handleMessage(message2); - Message out1 = replyChannel.receive(0); + Message out1 = replyChannel.receive(10); assertNull(out1); out1 = discardChannel.receive(1000); assertNotNull(out1); - Message out2 = discardChannel.receive(0); + Message out2 = discardChannel.receive(10); assertNotNull(out2); Message message1 = createMessage("123", "ABC", 3, 1, null); this.resequencer.handleMessage(message1); @@ -372,7 +372,7 @@ public class ResequencerTests { assertNull(out1); out1 = discardChannel.receive(1000); assertNotNull(out1); - Message out2 = discardChannel.receive(0); + Message out2 = discardChannel.receive(10); assertNotNull(out2); Message message1 = createMessage("123", "ABC", 3, 1, null); this.resequencer.handleMessage(message1); diff --git a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationsWithBeanAnnotationTests.java b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationsWithBeanAnnotationTests.java index 4045cbb0ae..879d84c3cf 100644 --- a/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationsWithBeanAnnotationTests.java +++ b/spring-integration-core/src/test/java/org/springframework/integration/config/annotation/MessagingAnnotationsWithBeanAnnotationTests.java @@ -91,7 +91,7 @@ public class MessagingAnnotationsWithBeanAnnotationTests { public void testMessagingAnnotationsFlow() { this.sourcePollingChannelAdapter.start(); for (int i = 0; i < 10; i++) { - Message receive = this.discardChannel.receive(1000); + Message receive = this.discardChannel.receive(10000); assertNotNull(receive); assertTrue(((Integer) receive.getPayload()) % 2 == 0); }