Navigation Menu

Skip to content

Commit

Permalink
Automatically disable test timeout when running in a debugger.
Browse files Browse the repository at this point in the history
(cherry picked from commit abf3359)
  • Loading branch information
jglick committed Jun 10, 2014
1 parent 03a26f3 commit 0f859a3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/src/main/java/org/jvnet/hudson/test/JenkinsRule.java
Expand Up @@ -291,7 +291,7 @@ public class JenkinsRule implements TestRule, MethodRule, RootAction {
/**
* Number of seconds until the test times out.
*/
public int timeout = Integer.getInteger("jenkins.test.timeout", 180);
public int timeout = Integer.getInteger("jenkins.test.timeout", System.getProperty("maven.surefire.debug") == null ? 180 : 0);

private volatile Timer timeoutTimer;

Expand Down Expand Up @@ -383,8 +383,10 @@ protected void configureUpdateCenter() throws Exception {
}

protected void setUpTimeout() {
if (timeout<=0) return; // no timeout

if (timeout <= 0) {
System.out.println("Test timeout disabled.");
return;
}
final Thread testThread = Thread.currentThread();
timeoutTimer = new Timer();
timeoutTimer.schedule(new TimerTask() {
Expand Down

0 comments on commit 0f859a3

Please sign in to comment.