Skip to content
Permalink
Browse files

Simpler workaround for JENKINS-27421.

  • Loading branch information
jglick committed Sep 21, 2016
1 parent d35a7e0 commit 4a65e417fe403ea4be8f48be2031bfb5d808a540
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/test/java/org/jenkinsci/plugins/workflow/SerializationTest.java
@@ -194,21 +194,21 @@ public void stop(Throwable cause) throws Exception {
ScriptApproval.get().approveSignature("method java.util.Map entrySet");
p.setDefinition(new CpsFlowDefinition(
"def map = [one: 1, two: 2]\n" +
"@NonCPS def entries(m) {m.collect {k, v -> [k, v]}}; mapE = entries(map); for (int i = 0; i < mapE.size(); i++) {def e = mapE[i]; echo \"running C-style loop on ${e[0]} → ${e[1]}\"; semaphore \"C-${e[0]}\"}\n" +
"@NonCPS def entries(m) {m.collect {k, v -> [k, v]}}; for (def e in entries(map)) {echo \"running flattened loop on ${e[0]} → ${e[1]}\"; semaphore \"C-${e[0]}\"}\n" +
"for (def e : map.entrySet()) {echo \"running new-style loop on ${e.key} → ${e.value}\"; semaphore \"new-${e.key}\"}"
// TODO check also keySet(), values()
, true));
startBuilding();
SemaphoreStep.waitForStart("C-one/1", b);
story.j.waitForMessage("running C-style loop on one → 1", b);
story.j.waitForMessage("running flattened loop on one → 1", b);
}
});
story.addStep(new Statement() {
@Override public void evaluate() throws Throwable {
rebuildContext(story.j);
SemaphoreStep.success("C-one/1", null);
SemaphoreStep.success("C-two/1", null);
story.j.waitForMessage("running C-style loop on two → 2", b);
story.j.waitForMessage("running flattened loop on two → 2", b);
SemaphoreStep.waitForStart("new-one/1", b);
story.j.waitForMessage("running new-style loop on one → 1", b);
}

0 comments on commit 4a65e41

Please sign in to comment.