Skip to content

Commit

Permalink
Merge pull request #836 from jglick/TailLog.waitForCompletion
Browse files Browse the repository at this point in the history
Do not let `TailLog.waitForCompletion` block forever
  • Loading branch information
jglick authored Sep 19, 2024
2 parents 9e8bb87 + 3570a3e commit 6ff4dcb
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 6ff4dcb

Please sign in to comment.