INT-4023: Fix MongoDB MGSs timing issue
JIRA: https://jira.spring.io/browse/INT-4023 There is no guaranty that following `System.currentTimeMillis()` return the same value. That is how the `assertEquals()` test for `created` and `modified` value may fail sporadically. * Fix `MongoDbMessageStore` and `ConfigurableMongoDbMessageStore` do not use a new `System.currentTimeMillis()` in case of `group create` **Cherry-pick to 4.2.x**
This commit is contained in:
@@ -235,7 +235,7 @@ public abstract class AbstractMongoDbMessageGroupStoreTests extends MongoDbAvail
|
||||
long createdTimestamp = messageGroup.getTimestamp();
|
||||
long updatedTimestamp = messageGroup.getLastModified();
|
||||
assertEquals(createdTimestamp, updatedTimestamp);
|
||||
Thread.sleep(1000);
|
||||
Thread.sleep(10);
|
||||
message = new GenericMessage<String>("Hello again");
|
||||
messageGroup = store.addMessageToGroup(1, message);
|
||||
createdTimestamp = messageGroup.getTimestamp();
|
||||
|
||||
Reference in New Issue
Block a user