diff options
author | Sébastien Lesaint <sebastien.lesaint@sonarsource.com> | 2019-09-19 17:47:05 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-09-20 11:19:18 +0200 |
commit | 6e4522f2c1e332fd81e6fedc18eb3808c35e0dd1 (patch) | |
tree | e4ad4310cabb06cfcbf5abfac503437424f81899 /server/sonar-main | |
parent | 10a1454ce0e0b97f00e2792942f1e2131bc877db (diff) | |
download | sonarqube-6e4522f2c1e332fd81e6fedc18eb3808c35e0dd1.tar.gz sonarqube-6e4522f2c1e332fd81e6fedc18eb3808c35e0dd1.zip |
fix unstable SchedulerImpl#restart_stops_all_and_restarts_all_processes
Diffstat (limited to 'server/sonar-main')
-rw-r--r-- | server/sonar-main/src/test/java/org/sonar/application/SchedulerImplTest.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/server/sonar-main/src/test/java/org/sonar/application/SchedulerImplTest.java b/server/sonar-main/src/test/java/org/sonar/application/SchedulerImplTest.java index 016e228ca60..eeffd10bb00 100644 --- a/server/sonar-main/src/test/java/org/sonar/application/SchedulerImplTest.java +++ b/server/sonar-main/src/test/java/org/sonar/application/SchedulerImplTest.java @@ -198,21 +198,20 @@ public class SchedulerImplTest { @Test public void restart_stops_all_and_restarts_all_processes() throws InterruptedException, IOException { + CountDownLatch restarting = new CountDownLatch(1); Scheduler underTest = startAll(); Mockito.doAnswer(t -> { orderedStops.clear(); appState.reset(); + processLauncher.reset(); + restarting.countDown(); return null;}) .when(appReloader).reload(settings); processLauncher.waitForProcess(WEB_SERVER).askedForRestart = true; - // waiting for all processes to be stopped - processLauncher.waitForProcessDown(COMPUTE_ENGINE).reset(); - processLauncher.waitForProcessDown(WEB_SERVER).reset(); - processLauncher.waitForProcessDown(ELASTICSEARCH).reset(); - processLauncher.reset(); - + // waiting for SQ to initiate restart + restarting.await(); playAndVerifyStartupSequence(); underTest.stop(); |