[core] Fix non-determinism in introduction integration tests

This commit is contained in:
Torsten Grote
2018-11-02 12:46:47 -03:00
parent 5cc8c268ca
commit 45dd10db9d
2 changed files with 11 additions and 3 deletions

View File

@@ -595,7 +595,7 @@ public class IntroductionIntegrationTest
@Test
public void testIntroductionToExistingContact() throws Exception {
// let contact1 and contact2 add each other already
addContacts1And2();
addContacts1And2(true);
assertNotNull(contactId2From1);
assertNotNull(contactId1From2);
@@ -650,7 +650,7 @@ public class IntroductionIntegrationTest
@Test
public void testIntroductionToRemovedContact() throws Exception {
// let contact1 and contact2 add each other
addContacts1And2();
addContacts1And2(true);
assertNotNull(contactId2From1);
assertNotNull(contactId1From2);

View File

@@ -309,6 +309,11 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
}
protected void addContacts1And2() throws Exception {
addContacts1And2(false);
}
protected void addContacts1And2(boolean haveTransportProperties)
throws Exception {
contactId2From1 = contactManager1
.addContact(author2, author1.getId(), getSecretKey(),
clock.currentTimeMillis(), true, true, true);
@@ -319,7 +324,10 @@ public abstract class BriarIntegrationTest<C extends BriarIntegrationTestCompone
// Sync initial client versioning updates
sync1To2(1, true);
sync2To1(1, true);
sync1To2(1, true);
sync1To2(haveTransportProperties ? 2 : 1, true);
if (haveTransportProperties) {
sync2To1(1, true);
}
}
@After