mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
[core] Fix non-determinism in introduction integration tests
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user