From 664d67f9bbfb2ee00bab1813e11a85b3b90adc8b Mon Sep 17 00:00:00 2001 From: Artem Bilan Date: Fri, 4 May 2018 13:06:09 -0400 Subject: [PATCH] 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` --- .../integration/jdbc/store/JdbcMessageStoreTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java index abdc156cb8..fc8146e58f 100644 --- a/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java +++ b/spring-integration-jdbc/src/test/java/org/springframework/integration/jdbc/store/JdbcMessageStoreTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -385,7 +385,9 @@ public class JdbcMessageStoreTests { String groupId = "X"; messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("foo").setCorrelationId(groupId).build()); + Thread.sleep(10); messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("bar").setCorrelationId(groupId).build()); + Thread.sleep(10); messageStore.addMessagesToGroup(groupId, MessageBuilder.withPayload("baz").setCorrelationId(groupId).build()); messageStore.addMessagesToGroup("Y", MessageBuilder.withPayload("barA").setCorrelationId(groupId).build(),