提交 ebfc3390 编写于 作者: J jglick

[HUDSON-2721] Calling task with a timeout to help diagnose hang.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@13539 71c3de6d-444a-0410-be80-ed276b4c234a
上级 f7817e53
......@@ -17,6 +17,7 @@ import java.io.File;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
/**
* @author Kohsuke Kawaguchi
......@@ -71,7 +72,9 @@ public class JNLPLauncherTest extends HudsonTestCase {
assertFalse("Slave failed to go online", c.isOffline());
// run some trivial thing
c.getChannel().call(new NoopTask());
System.err.println("Calling task...");
assertEquals("done", c.getChannel().callAsync(new NoopTask()).get(5, TimeUnit.MINUTES));
System.err.println("...done.");
} finally {
proc.kill();
}
......@@ -106,7 +109,7 @@ public class JNLPLauncherTest extends HudsonTestCase {
private static class NoopTask implements Callable<String,RuntimeException> {
public String call() {
return null;
return "done";
}
private static final long serialVersionUID = 1L;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册