Skip to content
Open
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 @@ -98,7 +98,8 @@ public void testExecutorService() throws Exception {
ExecutorStatus status = executor.getStatus();
assertTrue(status.queuedEvents.isEmpty());
assertEquals(5, status.running.size());
checkStatusDump(status);
Waiter.waitFor(mockedServer.getConfiguration(), 10000,
() -> checkStatusDump(executor.getStatus()));

// Now interrupt the running Executor
synchronized (lock) {
Expand Down Expand Up @@ -141,13 +142,13 @@ public void testExecutorService() throws Exception {
.submit(new TestEventHandler(mockedServer, EventType.M_SERVER_SHUTDOWN, lock, counter));
}

private void checkStatusDump(ExecutorStatus status) throws IOException {
private boolean checkStatusDump(ExecutorStatus status) throws IOException {
StringWriter sw = new StringWriter();
status.dumpTo(sw, "");
String dump = sw.toString();
LOG.info("Got status dump:\n" + dump);

assertTrue(dump.contains("Waiting on java.util.concurrent.atomic.AtomicBoolean"));
return dump.contains("Waiting on java.util.concurrent.atomic.AtomicBoolean");
}

public static class TestEventHandler extends EventHandler {
Expand Down