Skip to content

Commit

Permalink
Merge pull request #5702 from jfdenise/WFCORE-6486
Browse files Browse the repository at this point in the history
Fix for WFCORE-6486, CLIEmbedHostControllerTestCase fails randomly with JDK 17 Jobs
  • Loading branch information
yersan authored Oct 6, 2023
2 parents fec6a97 + e159fdd commit 79b4d17
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -758,8 +758,27 @@ private String readLogOut() {
}

private void checkLogging(String line) throws IOException {
String logOutput = readLogOut();
assertTrue(logOutput, checkLogging(logOutput, line));
long delay = System.currentTimeMillis() + TimeoutUtil.adjust(10000);
boolean traceSeen = false;
StringBuilder allOutput = new StringBuilder();
do {
String logOutput = readLogOut();
if (logOutput != null) {
allOutput.append(logOutput);
}
if (checkLogging(allOutput.toString(), line)) {
traceSeen = true;
break;
} else {
try {
Thread.sleep(50);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IOException("Interrupted");
}
}
} while (System.currentTimeMillis() < delay);
assertTrue("Trace " + line + " not seen in log: " + allOutput, traceSeen);
}

private boolean checkLogging(String logOutput, String line) throws IOException {
Expand Down

0 comments on commit 79b4d17

Please sign in to comment.