diff options
author | David Gageot <david@gageot.net> | 2015-07-06 17:34:50 +0200 |
---|---|---|
committer | David Gageot <david@gageot.net> | 2015-07-06 17:34:50 +0200 |
commit | 839ce14ebc4d6befc37a447e90ad49b2607fb753 (patch) | |
tree | 31c9172f8df9184ab5d0f33593fac9f98a31f365 /server/sonar-process | |
parent | b148ed714b02e414ab0c3c8ce894665b3013787d (diff) | |
download | sonarqube-839ce14ebc4d6befc37a447e90ad49b2607fb753.tar.gz sonarqube-839ce14ebc4d6befc37a447e90ad49b2607fb753.zip |
Fix Flaky test
Diffstat (limited to 'server/sonar-process')
-rw-r--r-- | server/sonar-process/src/test/java/org/sonar/process/StopWatcherTest.java | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/server/sonar-process/src/test/java/org/sonar/process/StopWatcherTest.java b/server/sonar-process/src/test/java/org/sonar/process/StopWatcherTest.java index e78d1c17b3e..038aff4b046 100644 --- a/server/sonar-process/src/test/java/org/sonar/process/StopWatcherTest.java +++ b/server/sonar-process/src/test/java/org/sonar/process/StopWatcherTest.java @@ -19,10 +19,7 @@ */ package org.sonar.process; -import java.util.concurrent.TimeUnit; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.Timeout; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.never; @@ -30,11 +27,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; public class StopWatcherTest { - - @Rule - public Timeout timeout = new Timeout(1000, TimeUnit.MILLISECONDS); - - @Test + @Test(timeout = 1000) public void stop_if_receive_command() throws InterruptedException { ProcessCommands commands = mock(ProcessCommands.class); when(commands.askedForStop()).thenReturn(false, true); @@ -47,7 +40,7 @@ public class StopWatcherTest { verify(stoppable).stopAsync(); } - @Test + @Test(timeout = 5000) public void stop_watching_on_interruption() throws InterruptedException { ProcessCommands commands = mock(ProcessCommands.class); when(commands.askedForStop()).thenReturn(false); |