Skip to content

Commit 5dc4565

Browse files
committed
BEE-15265
avoid race condition causing flake
1 parent 5f77179 commit 5dc4565

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/test/java/org/jenkinsci/plugins/workflow/cps/FlowDurabilityTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,8 @@ public void evaluate() throws Throwable {
777777
WorkflowRun run = createAndRunSleeperJob(story.j.jenkins, jobName, FlowDurabilityHint.MAX_SURVIVABILITY, false);
778778
FlowExecution exec = run.getExecution();
779779
if (exec instanceof CpsFlowExecution) {
780-
assert ((CpsFlowExecution) exec).getStorage().isPersistedFully();
780+
((CpsFlowExecution) exec).waitForSuspension(); // till done writing head node ID into build.xml
781+
assert ((CpsFlowExecution) exec).getStorage().isPersistedFully(); // single node xmls written
781782
}
782783
nodesOut.addAll(new DepthFirstScanner().allNodes(run.getExecution()));
783784
nodesOut.sort(FlowScanningUtils.ID_ORDER_COMPARATOR);

0 commit comments

Comments
 (0)