Skip to content

Commit

Permalink
Aggressively wait and log
Browse files Browse the repository at this point in the history
  • Loading branch information
io7m committed Apr 27, 2023
1 parent fca2042 commit f3e1751
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,22 @@ private void waitForClose(
{
LOG.debug("{}: waiting for close", this.testInfo.getDisplayName());

while (!leakedClient.isClosed()) {
for (int index = 0; index < 1000_000_00; ++index) {
LOG.debug(
"{}: still waiting ({})",
this.testInfo.getDisplayName(),
leakedClient.stateNow()
);

if (leakedClient.isClosed()) {
break;
}
sleep();
}

LOG.debug("{}: waited for close successfully", this.testInfo.getDisplayName());
LOG.debug(
"{}: waited for close successfully",
this.testInfo.getDisplayName());
}

private static void sleep()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,11 @@ private void waitForClose(
LOG.debug("{}: waiting for close", this.testInfo.getDisplayName());

for (int index = 0; index < 1000_000_00; ++index) {
if (index % 100 == 0) {
LOG.debug(
"{}: still waiting ({})",
this.testInfo.getDisplayName(),
leakedClient.stateNow()
);
}
LOG.debug(
"{}: still waiting ({})",
this.testInfo.getDisplayName(),
leakedClient.stateNow()
);

if (leakedClient.isClosed()) {
break;
Expand Down

0 comments on commit f3e1751

Please sign in to comment.