Skip to content

Commit a42bbe1

Browse files
artembilanspring-builds
authored andcommitted
RetryingTest for ZeroMqDslTests
There is some race condition between ZeroMQ publisher and subscriber (cherry picked from commit 83cb9c9)
1 parent de4a96b commit a42bbe1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

  • spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/dsl

spring-integration-zeromq/src/test/java/org/springframework/integration/zeromq/dsl/ZeroMqDslTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import java.util.concurrent.LinkedBlockingQueue;
2222
import java.util.concurrent.TimeUnit;
2323

24-
import org.junit.jupiter.api.Test;
24+
import org.junitpioneer.jupiter.RetryingTest;
2525
import org.zeromq.SocketType;
2626
import org.zeromq.ZContext;
2727

@@ -69,7 +69,7 @@ public class ZeroMqDslTests {
6969
@Autowired
7070
IntegrationFlowContext integrationFlowContext;
7171

72-
@Test
72+
@RetryingTest(10)
7373
void testZeroMqDslIntegration() throws InterruptedException {
7474
BlockingQueue<Message<?>> results = new LinkedBlockingQueue<>();
7575

@@ -102,13 +102,13 @@ void testZeroMqDslIntegration() throws InterruptedException {
102102

103103
assertThat(message.getHeaders()).containsEntry(ZeroMqHeaders.TOPIC, "someTopic");
104104

105-
message = results.poll(1, TimeUnit.SECONDS);
105+
message = results.poll(10, TimeUnit.SECONDS);
106106
assertThat(message).isNotNull()
107107
.extracting(Message::getPayload)
108108
.isEqualTo("test");
109109

110110
// With Pub/Sub channel we would have 4 messages.
111-
assertThat(results.poll(1, TimeUnit.SECONDS)).isNull();
111+
assertThat(results.poll(100, TimeUnit.MILLISECONDS)).isNull();
112112

113113
this.integrationFlowContext.getRegistry()
114114
.values()

0 commit comments

Comments
 (0)