fix intermittent test failure
I believe this test failed because the jenkins slave node that gets created in the test does not come online fast enough. The test now polls to make sure the slave is online before continuing. Change-Id: I2a86d0b550daf70e5d2041994d78ff5e4649a62b
This commit is contained in:
parent
d3bc4dda56
commit
07026b7b71
|
@ -44,6 +44,19 @@ public class ExecutorWorkerThreadTest extends HudsonTestCase {
|
|||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
slave = createOnlineSlave(new LabelAtom("oneiric-10"));
|
||||
|
||||
// poll to make sure test slave is online before continuing
|
||||
long timeoutExpiredMs = System.currentTimeMillis() + 3000;
|
||||
while (true) {
|
||||
if (slave.getChannel() != null) {
|
||||
break;
|
||||
}
|
||||
this.wait(timeoutExpiredMs - System.currentTimeMillis());
|
||||
if (System.currentTimeMillis() >= timeoutExpiredMs) {
|
||||
fail("Could not start test slave");
|
||||
}
|
||||
}
|
||||
|
||||
slave.setLabelString("ubuntu gcc python-2.4 linux");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue