Skip to content

Commit

Permalink
Do not let TailLog.waitForCompletion block forever
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick committed Sep 18, 2024
1 parent 5db817b commit 3570a3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/org/jvnet/hudson/test/TailLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.input.Tailer;
import org.apache.commons.io.input.TailerListenerAdapter;
import static org.junit.Assert.assertTrue;
import org.jvnet.hudson.test.recipes.LocalData;

/**
Expand Down Expand Up @@ -116,7 +118,7 @@ public void handle(String line) {
}

public void waitForCompletion() throws InterruptedException {
finished.acquire();
assertTrue(finished.tryAcquire(1, TimeUnit.MINUTES));
}

@Override
Expand Down

0 comments on commit 3570a3e

Please sign in to comment.