Skip to content

Commit 664d67f

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`
1 parent 4fd638e commit 664d67f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -385,7 +385,9 @@ public void testMessagePollingFromTheGroup() throws Exception {
385385
String groupId = "X";
386386

387387
messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("foo").setCorrelationId(groupId).build());
388+
Thread.sleep(10);
388389
messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("bar").setCorrelationId(groupId).build());
390+
Thread.sleep(10);
389391
messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("baz").setCorrelationId(groupId).build());
390392

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

0 commit comments

Comments
 (0)