From 00dcc7ab9ad0ddfbcb16e7b5a84f44e807166188 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Fri, 13 Nov 2020 15:40:10 -0500 Subject: [PATCH 1/2] Corrected flake in StashTest.smokes --- .../plugins/workflow/support/steps/stash/StashTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java b/src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java index 21b351b2..0d0ff654 100644 --- a/src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java +++ b/src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java @@ -73,7 +73,9 @@ public class StashTest { SemaphoreStep.success("ending/1", null); r.assertBuildStatusSuccess(r.waitForCompletion(b)); r.assertLogContains("got fname: whatever other: more", b); - assertEquals("{}", StashManager.stashesOf(b).toString()); // TODO flake expected:<{[]}> but was:<{[from-top={elsewhere/fname=whatever}, whatever={fname=whatever, other=more}]}> + while (!StashManager.stashesOf(b).isEmpty()) { + Thread.sleep(100); + } } @Issue("JENKINS-31086") From 7dffe3426cc80338866e40db31ab9fa2569dc670 Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 16 Nov 2020 12:15:00 -0500 Subject: [PATCH 2/2] testAllowEmpty can also flake --- .../plugins/workflow/support/steps/stash/StashTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java b/src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java index 0d0ff654..25c57da3 100644 --- a/src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java +++ b/src/test/java/org/jenkinsci/plugins/workflow/support/steps/stash/StashTest.java @@ -116,7 +116,9 @@ public class StashTest { SemaphoreStep.success("ending/1", null); r.assertBuildStatusSuccess(r.waitForCompletion(b)); r.assertLogContains("Stashed 0 file(s)", b); - assertEquals("{}", StashManager.stashesOf(b).toString()); + while (!StashManager.stashesOf(b).isEmpty()) { + Thread.sleep(100); + } List coreStepNodes = new DepthFirstScanner().filteredNodes(b.getExecution(), new NodeStepTypePredicate("stash")); assertThat(coreStepNodes, Matchers.hasSize(1)); assertEquals("whatever", ArgumentsAction.getStepArgumentsAsString(coreStepNodes.get(0)));