diff --git a/src/test/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest.java b/src/test/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest.java index 2bb34485..86309d01 100644 --- a/src/test/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest.java +++ b/src/test/java/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest.java @@ -56,7 +56,6 @@ import org.jenkinsci.plugins.workflow.steps.StepExecution; import org.jenkinsci.plugins.workflow.test.steps.SemaphoreStep; import org.junit.ClassRule; -import org.junit.Ignore; import org.junit.Test; import org.junit.Rule; import org.jvnet.hudson.test.BuildWatcher; @@ -65,7 +64,6 @@ import org.jvnet.hudson.test.JenkinsSessionRule; import org.jvnet.hudson.test.MemoryAssert; import org.jvnet.hudson.test.TestExtension; -import org.jvnet.hudson.test.recipes.LocalData; import org.kohsuke.stapler.DataBoundConstructor; public class FlowExecutionListTest { @@ -165,32 +163,6 @@ public class FlowExecutionListTest { }); } - @Ignore("Build never completes due to infinite loop") - @LocalData - @Test public void stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuckInfiniteLoop() throws Throwable { - // LocalData created using the following snippet while the build was waiting in the _second_ sleep, except - // for build.xml, which was captured during the sleep step. The StepEndNode for the stage was then adjusted to - // have its startId point to the timeout step's StepStartNode, creating a loop. - /* - sessions.then(r -> { - var stuck = r.createProject(WorkflowJob.class); - stuck.setDefinition(new CpsFlowDefinition("stage('stage') { sleep 30 }; timeout(time: 10) { sleep 30 }", true)); - var b = stuck.scheduleBuild2(0).waitForStart(); - System.out.println(b.getRootDir()); - r.waitForCompletion(b); - }); - */ - sessions.then(r -> { - var p = r.jenkins.getItemByFullName("test0", WorkflowJob.class); - var b = p.getBuildByNumber(1); - // TODO: Create and run a new build, call StepExecutionIterator.applyAll while it is running, and assert - // that we do not leak a hard reference to it through the task queue for the CpsVmExecutorService for the - // stuck build and the futures inside of StepExecutionIteratorImpl.applyAll. - // TODO: Ideally, we would detect the issue with the stuck build and find some way to kill it. - r.waitForCompletion(b); - }); - } - @Test public void stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck() throws Throwable { sessions.then(r -> { var notStuck = r.createProject(WorkflowJob.class, "not-stuck"); @@ -200,7 +172,7 @@ public class FlowExecutionListTest { WeakReference notStuckBuildRef = new WeakReference<>(notStuckBuild); // Create a Pipeline that runs a long-lived task on its CpsVmExecutorService, causing it to get stuck. var stuck = r.createProject(WorkflowJob.class, "stuck"); - stuck.setDefinition(new CpsFlowDefinition("parallel(one: { echo 'test message'; Thread.sleep(Integer.MAX_VALUE); })", false)); + stuck.setDefinition(new CpsFlowDefinition("echo 'test message'; Thread.sleep(Integer.MAX_VALUE)", false)); var stuckBuild = stuck.scheduleBuild2(0).waitForStart(); r.waitForMessage("test message", stuckBuild); Thread.sleep(1000); // We need Thread.sleep to be running in the CpsVmExecutorService. diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/build.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/build.xml deleted file mode 100644 index d2b7e367..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/build.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - 1 - 1722979974600 - 1722979974615 - 0 - UTF-8 - false - - SUCCESS - - - MAX_SURVIVABILITY - - - flowNode - 101709541 - - - classLoad - 124446251 - - - run - 200459289 - - - parse - 166818958 - - - saveProgram - 57936125 - - - - true - 5 - 1:5 - 2 - false - false - - false - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/log b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/log deleted file mode 100644 index f8c5883d..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/log +++ /dev/null @@ -1,13 +0,0 @@ -Started -ha:////4LSn6sjy3SQJvLr4M0Jcw5zYiu9jzzxAhCQhf5ciKGcGAAAAoh+LCAAAAAAAAP9tjTEOwjAQBM8BClpKHuFItIiK1krDC0x8GCfWnbEdkooX8TX+gCESFVvtrLSa5wtWKcKBo5UdUu8otU4GP9jS5Mixv3geZcdn2TIl9igbHBs2eJyx4YwwR1SwULBGaj0nRzbDRnX6rmuvydanHMu2V1A5c4MHCFXMWcf8hSnC9jqYxPTz/BXAFEIGsfuclm8zQVqFvQAAAA==[Pipeline] Start of Pipeline -ha:////4FLPcBhXXN+T+Uy5Bq+9NjiuG45smS/CK+MQ8sUKcTBsAAAApR+LCAAAAAAAAP9tjTEOwjAUQ3+KOrAycohUghExsUZZOEFIQkgb/d8mKe3EibgadyBQiQlLlmxL1nu+oE4RjhQdby12HpP2vA+jK4lPFLtroIm3dOGaMFGwXNpJkrGnpUrKFhaxClYC1hZ1oOTRZdiIVt1VExS65pxj2Q4CKm8GeAAThZxVzN8yR9jeRpMIf5y/AJj7DGxXvP/86jduZBmjwAAAAA==[Pipeline] stage -ha:////4MPOLP4Go7JuW3NkAKhksIfyE+NroTrcISNM8xfRFLQ8AAAApR+LCAAAAAAAAP9tjTEOwjAUQ3+KOrAycoh0gA0xsUZZOEFIQkgb/d8mKe3EibgadyBQiQlLlmxL1nu+oE4RjhQdby12HpP2vA+jK4lPFLtroIm3dOGaMFGwXNpJkrGnpUrKFhaxClYC1hZ1oOTRZdiIVt1VExS65pxj2Q4CKm8GeAAThZxVzN8yR9jeRpMIf5y/AJj7DGxXvP/86jfoP95RwAAAAA==[Pipe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XYaNaNVdNUGha845lu0goPJmgAcwUchZxfwtc4TtbTSJ8Mf5C4C5z8B2xfvPr34DrZTeycAAAAA=[Pipeline] timeout -Timeout set to expire in 10 min -ha:////4M9FYx/jFzgoF1Ji4m6uzCtxEvJBQzBzYoKBBTbKepUTAAAApR+LCAAAAAAAAP9tjTEOwjAUQ3+KOrAycoh0BSEm1igLJwhJCGmj/9skpZ04EVfjDgQqMWHJkm3Jes8X1CnCkaLjrcXOY9Ke92F0JfGJYncNNPGWLlwTJgqWSztJMva0VEnZwiJWwUrA2qIOlDy6DBvRqrtqgkLXnHMs20FA5c0AD2CikLOK+VvmCNvbaBLhj/MXAHOfge2K959f/QbB16AVwAAAAA==[Pipeline] { -ha:////4O/MG/IybiYM4oG30m877qNjUwTyRLwWY87qTVAOsZwoAAAAoh+LCAAAAAAAAP9tjTEOwjAQBDdBFLSUPMKBEiEqWisNLzCJMU6su2BfSCpexNf4AxGRqNhqZ5p5vbFMEUeOTjWWWk+p8qoLvZueGji218CDaviiKqbEwarSDiXX9jRjyWIxL8ux0FhZqgInT06w1o15mCIYcsVZ4uQOGrmv73gi01NZTJQvjBGbW18npl/nbwBjJ8j2gny37T6VOYoyvQAAAA==[Pipeline] sleep -Sleeping for 30 sec diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/log-index b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/log-index deleted file mode 100644 index bfafbf78..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/log-index +++ /dev/null @@ -1,5 +0,0 @@ -1232 5 -1252 -2157 8 -2189 -2789 10 diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/program.dat b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/program.dat deleted file mode 100644 index aeae086b..00000000 Binary files a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/program.dat and /dev/null differ diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/10.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/10.xml deleted file mode 100644 index 2f9ecb73..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/10.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - 9 - - 10 - org.jenkinsci.plugins.workflow.steps.SleepStep - - - - - - time - 30 - - - - true - - - 1722980005296 - - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/2.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/2.xml deleted file mode 100644 index 213232ad..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/2.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - 2 - - - - 1722979974868 - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/3.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/3.xml deleted file mode 100644 index ff65b2ee..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/3.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - 2 - - 3 - org.jenkinsci.plugins.workflow.support.steps.StageStep - - - - - - - name - stage - - - - true - - - 1722979974972 - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/4.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/4.xml deleted file mode 100644 index 0f422ed2..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/4.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - 3 - - 4 - org.jenkinsci.plugins.workflow.support.steps.StageStep - - - - - stage - - - 1722979974988 - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/5.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/5.xml deleted file mode 100644 index 5dcd2edd..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/5.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - 4 - - 5 - org.jenkinsci.plugins.workflow.steps.SleepStep - - - - - - time - 30 - - - - true - - - 1722979975077 - - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/6.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/6.xml deleted file mode 100644 index 967f277a..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/6.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - 5 - - 6 - 4 - - - - - 1722980005117 - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/7.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/7.xml deleted file mode 100644 index 3625f1ef..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/7.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - 6 - - 7 - 8 - - - - 1722980005177 - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/8.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/8.xml deleted file mode 100644 index ea60fd6d..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/8.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - 7 - - 8 - org.jenkinsci.plugins.workflow.steps.TimeoutStep - - - - - - - time - 10 - - - - true - - - 1722980005227 - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/9.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/9.xml deleted file mode 100644 index a5767ab8..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/1/workflow/9.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - 8 - - 9 - org.jenkinsci.plugins.workflow.steps.TimeoutStep - - - - - 1722980005244 - - - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/legacyIds b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/builds/legacyIds deleted file mode 100644 index e69de29b..00000000 diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/config.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/config.xml deleted file mode 100644 index 826019f9..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/config.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - false - - - - true - - - false - \ No newline at end of file diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/nextBuildNumber b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/nextBuildNumber deleted file mode 100644 index 0cfbf088..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/jobs/test0/nextBuildNumber +++ /dev/null @@ -1 +0,0 @@ -2 diff --git a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/org.jenkinsci.plugins.workflow.flow.FlowExecutionList.xml b/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/org.jenkinsci.plugins.workflow.flow.FlowExecutionList.xml deleted file mode 100644 index 56b066fd..00000000 --- a/src/test/resources/org/jenkinsci/plugins/workflow/flow/FlowExecutionListTest/stepExecutionIteratorDoesNotLeakBuildsWhenOneIsStuck/org.jenkinsci.plugins.workflow.flow.FlowExecutionList.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - test0 - 1 - - \ No newline at end of file