diff --git a/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/management/cli/CLIEmbedServerTestCase.java b/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/management/cli/CLIEmbedServerTestCase.java index 183140009b6..fc0872e5a0c 100644 --- a/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/management/cli/CLIEmbedServerTestCase.java +++ b/testsuite/manualmode/src/test/java/org/jboss/as/test/manualmode/management/cli/CLIEmbedServerTestCase.java @@ -215,7 +215,7 @@ private void stdoutTest(String paramVal) throws Exception { String line = "embed-server --admin-only=false --server-config=standalone-cli.xml " + stdoutParam + JBOSS_HOME; cli.sendLine(line); if (expectServerLogging) { - checkLogging("WFLYSRV0025"); + checkLogging("WFLYSRV0025", TimeoutUtil.adjust(30000)); } else { checkNoLogging("WFLYSRV0025"); } @@ -249,7 +249,7 @@ private void stdoutTest(String paramVal) throws Exception { } - private void checkClientSideLogging() throws IOException { + private void checkClientSideLogging() throws IOException, InterruptedException { String text = "test." + System.nanoTime(); Logger.getLogger(text).error(text); checkLogging(text); @@ -525,7 +525,7 @@ public void testStopServerOnTerminateSession() throws IOException { * Tests the --help param works. */ @Test - public void testHelp() throws IOException { + public void testHelp() throws IOException, InterruptedException { cli.sendLine("embed-server --help"); checkLogging("embed-server"); @@ -725,8 +725,20 @@ private String readLogOut() { return null; } - private void checkLogging(String line) throws IOException { + private void checkLogging(String line) throws IOException, InterruptedException { + checkLogging(line, 0); + } + + private void checkLogging(String line, int timeout) throws IOException, InterruptedException { String logOutput = readLogOut(); + long done = System.currentTimeMillis() + timeout; + while (timeout > 0 && System.currentTimeMillis() < done) { + if (checkLogging(logOutput, line)) { + break; + } else { + Thread.sleep(20); + } + } assertTrue(logOutput, checkLogging(logOutput, line)); }