Add retry after exceptions during a cluster topology change event callback

This commit is contained in:
Chris Eager
2023-03-23 09:50:15 -05:00
committed by Chris Eager
parent 0cc84131de
commit 3ccfeb490b
13 changed files with 323 additions and 132 deletions

View File

@@ -42,6 +42,8 @@ class ClientPresenceManagerTest {
private static final DisplacedPresenceListener NO_OP = connectedElsewhere -> {
};
private boolean expectExceptionOnClientPresenceManagerStop = false;
@BeforeEach
void setUp() throws Exception {
@@ -61,7 +63,13 @@ class ClientPresenceManagerTest {
presenceRenewalExecutorService.shutdown();
presenceRenewalExecutorService.awaitTermination(1, TimeUnit.MINUTES);
clientPresenceManager.stop();
try {
clientPresenceManager.stop();
} catch (final Exception e) {
if (!expectExceptionOnClientPresenceManagerStop) {
throw e;
}
}
}
@Test
@@ -294,6 +302,8 @@ class ClientPresenceManagerTest {
}
assertTrue(clientPresenceManager.isPresent(displacedAccountUuid, displacedAccountDeviceId));
expectExceptionOnClientPresenceManagerStop = true;
}
@Nested