Skip to content

Commit 60229bf

Browse files
committed
Hoping a more standard use of SemaphoreStep may avoid some unidentified race condition #515 (comment)
1 parent aa53bff commit 60229bf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/test/java/com/cloudbees/jenkins/support/impl/NodeExecutorsTest.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@
2121
import org.jenkinsci.plugins.workflow.job.WorkflowJob;
2222
import org.jenkinsci.plugins.workflow.job.WorkflowRun;
2323
import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep;
24+
import org.junit.ClassRule;
2425
import org.junit.Rule;
2526
import org.junit.Test;
27+
import org.jvnet.hudson.test.BuildWatcher;
2628
import org.jvnet.hudson.test.JenkinsRule;
2729

2830
/**
@@ -33,6 +35,9 @@ public class NodeExecutorsTest {
3335
@Rule
3436
public JenkinsRule j = new JenkinsRule();
3537

38+
@ClassRule
39+
public static BuildWatcher bw = new BuildWatcher();
40+
3641
@Test
3742
public void addContents() throws Exception {
3843
DumbSlave agent = j.createOnlineSlave(Label.parseExpression("test"), null);
@@ -91,7 +96,7 @@ public void addContentsRunningBuild() throws Exception {
9196
WorkflowRun workflowRun = Optional.ofNullable(p.scheduleBuild2(0))
9297
.orElseThrow(AssertionFailedError::new)
9398
.waitForStart();
94-
j.waitForMessage("Running on", workflowRun);
99+
SemaphoreStep.waitForStart("wait/1", workflowRun);
95100

96101
String executorMd = SupportTestUtils.invokeComponentToMap(new NodeExecutors(), agent.toComputer())
97102
.get("executors.md");

0 commit comments

Comments
 (0)