Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for WFCORE-6486, CLIEmbedHostControllerTestCase fails randomly with JDK 17 Jobs #5702

Merged
merged 1 commit into from
Oct 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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