diff options
-rw-r--r-- | server/sonar-process-monitor/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/sonar-process-monitor/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java b/server/sonar-process-monitor/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java index cc8a0baab1c..28103e103d8 100644 --- a/server/sonar-process-monitor/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java +++ b/server/sonar-process-monitor/src/test/java/org/sonar/application/cluster/HazelcastClusterTest.java @@ -48,6 +48,7 @@ import org.sonar.process.ProcessId; import org.sonar.process.ProcessProperties; import org.sonar.process.cluster.ClusterObjectKeys; +import static junit.framework.TestCase.fail; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.timeout; @@ -169,9 +170,11 @@ public class HazelcastClusterTest { }, false); hzClient.shutdown(); - latch.await(1, TimeUnit.SECONDS); - - assertThat(hzCluster.hzInstance.getSet(ClusterObjectKeys.CLIENT_UUIDS)).isEmpty(); + if (latch.await(5, TimeUnit.SECONDS)) { + assertThat(hzCluster.hzInstance.getSet(ClusterObjectKeys.CLIENT_UUIDS).size()).isEqualTo(0); + } else { + fail("The client UUID have not been removed from the Set within 5 seconds' time lapse"); + } } } |