De-randomize message tests to minimize flakiness.

This commit is contained in:
Jon Chambers 2020-07-14 18:09:16 -04:00 committed by Jon Chambers
parent b9b6e1818f
commit 247d869a5c
1 changed files with 4 additions and 2 deletions

View File

@ -34,6 +34,8 @@ public class MessagesTest {
private Messages messages;
private long serialTimestamp = 0;
@Before
public void setupAccountsDao() {
this.messages = new Messages(new FaultTolerantDatabase("messages-test", Jdbi.create(db.getTestDatabase()), new CircuitBreakerConfiguration()));
@ -233,8 +235,8 @@ public class MessagesTest {
return Envelope.newBuilder()
.setSourceDevice(random.nextInt(10000))
.setSource("testSource" + random.nextInt())
.setTimestamp(random.nextInt(100000))
.setServerTimestamp(random.nextInt(100000))
.setTimestamp(serialTimestamp++)
.setServerTimestamp(serialTimestamp++)
.setLegacyMessage(ByteString.copyFrom(legacy))
.setContent(ByteString.copyFrom(content))
.setType(Envelope.Type.CIPHERTEXT)