]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-7183 fix reliability CeProcessingSchedulerImplMultiThreadTest
authorSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 4 Mar 2016 13:55:46 +0000 (14:55 +0100)
committerSébastien Lesaint <sebastien.lesaint@sonarsource.com>
Fri, 4 Mar 2016 13:56:31 +0000 (14:56 +0100)
server/sonar-server/src/test/java/org/sonar/server/computation/taskprocessor/CeProcessingSchedulerImplMultiThreadTest.java

index 2d3eabea1abca0a0409c0f1370e7234f8e7b8ec5..b01e67cc0ebabadc014d80feb12be05fc435912f 100644 (file)
@@ -40,7 +40,7 @@ public class CeProcessingSchedulerImplMultiThreadTest {
 
   @Test
   public void when_workerCount_is_more_than_1_CeWorkerCallable_runs_on_as_many_different_threads() throws InterruptedException {
-    int workerCount = 4;
+    int workerCount = 2;
 
     ceConfiguration
         .setWorkerCount(workerCount)
@@ -55,8 +55,8 @@ public class CeProcessingSchedulerImplMultiThreadTest {
 
       underTest.startScheduling();
 
-      // scheduling starts only after 10ms, leave 100ms for the tasks to run
-      Thread.sleep(100);
+      // scheduling starts only after 10ms, leave 500ms for the tasks to run and make use of all available threads
+      Thread.sleep(500);
 
       assertThat(ceWorkerRunnable.getThreadNames()).hasSize(workerCount);
     }
@@ -72,7 +72,7 @@ public class CeProcessingSchedulerImplMultiThreadTest {
 
   private static class ThreadNameRecordingCeWorkerCallable implements CeWorkerCallable {
     private final Set<String> threadNames = new HashSet<>();
-    private final int maxCallCount = 10;
+    private final int maxCallCount = 100;
     private int callCount = 0;
 
     @Override