From 3cf0930f7f5ef287310a4a33b9c4f2fbdcbb1c4d Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Thu, 25 Sep 2014 09:53:58 +0200 Subject: [PATCH] Try to improve stability of CommandExecutorTest --- .../org/sonar/api/utils/command/CommandExecutorTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java index 0dcba90e1ed..7a1f4386312 100644 --- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java +++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/command/CommandExecutorTest.java @@ -53,7 +53,7 @@ public class CommandExecutorTest { workDir = tempFolder.newFolder(testName.getMethodName()); } - @Test + @Test(timeout = 3000L) public void should_consume_StdOut_and_StdErr() throws Exception { // too many false-positives on MS windows if (!SystemUtils.IS_OS_WINDOWS) { @@ -82,7 +82,7 @@ public class CommandExecutorTest { } } - @Test + @Test(timeout = 3000L) public void stdOut_consumer_can_throw_exception() throws Exception { Command command = Command.create(getScript("output")).setDirectory(workDir); thrown.expect(CommandException.class); @@ -90,12 +90,12 @@ public class CommandExecutorTest { CommandExecutor.create().execute(command, BAD_CONSUMER, NOP_CONSUMER, 1000L); } - @Test + @Test(timeout = 3000L) public void stdErr_consumer_can_throw_exception() throws Exception { Command command = Command.create(getScript("output")).setDirectory(workDir); thrown.expect(CommandException.class); thrown.expectMessage("Error inside stdErr stream"); - CommandExecutor.create().execute(command, NOP_CONSUMER, BAD_CONSUMER, 1000L); + CommandExecutor.create().execute(command, NOP_CONSUMER, BAD_CONSUMER, 1500L); } private static final StreamConsumer NOP_CONSUMER = new StreamConsumer() { -- 2.39.5