Subscribe to remote presence changes before setting the key

This commit is contained in:
Chris Eager authored and Chris Eager committed 2024-10-15 16:54:52 -05:00
1 parent 46227295ff
commit 830a07012b
2 files changed
+62 -18

No files matched your search

@@ -386,8 +386,8 @@ class ClientPresenceManagerTest {
displaced.join();
}
@RepeatedTest(value = 10, failureThreshold = 1)
void testConcurrentConnection() {
@RepeatedTest(value = 100)
void testConcurrentConnection() throws Exception {
final UUID uuid1 = UUID.randomUUID();
final byte deviceId = 1;
@@ -400,7 +400,13 @@ class ClientPresenceManagerTest {
server1Thread.start();
server2Thread.start();
assertTimeoutPreemptively(Duration.ofSeconds(10), displaced::join);
displaced.join();
server2Thread.join();
server1Thread.join();
while (server1.isLocallyPresent(uuid1, deviceId) == server2.isLocallyPresent(uuid1, deviceId)) {
Thread.sleep(50);
}
}
}