Skip to content

Commit

Permalink
[JENKINS-71406] Flake in NodeCanTakeTaskTest.becauseNodeIsBusy (#8115)
Browse files Browse the repository at this point in the history
  • Loading branch information
jglick authored Jun 10, 2023
1 parent 78a50f8 commit f22f25c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/src/test/java/hudson/slaves/NodeCanTakeTaskTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,17 @@ public void becauseNodeIsBusy() throws Exception {
project.setConcurrentBuild(true);
project.getBuildersList().add(new SleepBuilder(Long.MAX_VALUE));
FreeStyleBuild build = project.scheduleBuild2(0).waitForStart(); // consume the one executor
project.scheduleBuild2(0); // now try to reschedule
var build2F = project.scheduleBuild2(0); // now try to reschedule
Queue.Item item;
while ((item = r.jenkins.getQueue().getItem(project)) == null || !item.isBuildable()) {
Thread.sleep(100);
}
assertEquals(hudson.model.Messages.Queue_WaitingForNextAvailableExecutorOn(slave.getDisplayName()), item.getWhy());
build.doStop();
r.assertBuildStatus(Result.ABORTED, r.waitForCompletion(build));
FreeStyleBuild build2 = build2F.waitForStart();
build2.doStop();
r.assertBuildStatus(Result.ABORTED, r.waitForCompletion(build2));
}

}

0 comments on commit f22f25c

Please sign in to comment.