Skip to content

Commit 87757e1

Browse files
committed
Add small sleep between adding message to group
https://build.spring.io/browse/INT-FATS5IC-497 Fixes `JdbcMessageStoreTests` sporadic failure where there is no guarantee that message are going to be polled from the group the same order they've been inserted Cherry-pick to `5.0.x` (cherry picked from commit 664d67f)
1 parent 2919b30 commit 87757e1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,9 @@ public void testMessagePollingFromTheGroup() throws Exception {
386386
String groupId = "X";
387387

388388
messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("foo").setCorrelationId(groupId).build());
389+
Thread.sleep(10);
389390
messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("bar").setCorrelationId(groupId).build());
391+
Thread.sleep(10);
390392
messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("baz").setCorrelationId(groupId).build());
391393

392394
messageStore.addMessagesToGroup("Y", MessageBuilder.withPayload("barA").setCorrelationId(groupId).build(),

0 commit comments

Comments
 (0)