Fixing a test race condition

The test testDlqWithNativeSerializationEnabledOnDlqProducer fails on CI occasionally.
Adding a sleep of 1 second to give the retrying mechanism enough time to complete.
This commit is contained in:
Soby Chacko
2019-08-26 12:16:58 -04:00
parent 46cbeb1804
commit e1e46226d5

View File

@@ -544,6 +544,8 @@ public class KafkaBinderTests extends
Message<?> receivedMessage = receive(dlqChannel, 5);
assertThat(receivedMessage).isNotNull();
assertThat(receivedMessage.getPayload()).isEqualTo("foo".getBytes());
//Adding a 1 second sleep to give the retrying enough time to complete.
Thread.sleep(1000);
assertThat(handler.getInvocationCount())
.isEqualTo(consumerProperties.getMaxAttempts());
assertThat(receivedMessage.getHeaders()