Skip to content

Commit 9874f12

Browse files
committed
Failure seems to have been an artifact of the order of initialization of things in a test case: Computer.threadPoolForRemoting was creating threads using an inappropriate group.
1 parent af95e43 commit 9874f12

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plugin/src/test/java/org/jenkinsci/plugins/workflow/cps/CpsFlowExecutionMemoryTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
package org.jenkinsci.plugins.workflow.cps;
2626

2727
import groovy.lang.MetaClass;
28+
import hudson.model.Computer;
2829
import java.lang.ref.WeakReference;
2930
import java.lang.reflect.Field;
3031
import java.lang.reflect.Method;
@@ -67,6 +68,7 @@ public static void register(Object o) {
6768
}
6869

6970
@Test public void loaderReleased() throws Exception {
71+
Computer.threadPoolForRemoting.submit(() -> {}).get(); // do not let it be initialized inside the CpsVmExecutorService thread group
7072
WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p");
7173
r.jenkins.getWorkspaceFor(p).child("lib.groovy").write(CpsFlowExecutionMemoryTest.class.getName() + ".register(this)", null);
7274
p.setDefinition(new CpsFlowDefinition(CpsFlowExecutionMemoryTest.class.getName() + ".register(this); node {load 'lib.groovy'; evaluate(readFile('lib.groovy'))}", false));

0 commit comments

Comments
 (0)