File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
plugin/src/test/java/org/jenkinsci/plugins/workflow/cps Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -703,6 +703,26 @@ public boolean isAllowed(String groovyResourceUrl) {
703703 }
704704 }
705705
706+ @ Test public void evaluateAfterRestart () throws Throwable {
707+ sessions .then (r -> {
708+ WorkflowJob p = r .createProject (WorkflowJob .class , "p" );
709+ p .setDefinition (new CpsFlowDefinition (
710+ "def x = evaluate('class X {X() {}; def m1() {/OK/}}; new X()')\n " +
711+ "def y = evaluate('class Y {X x; def m2() {/really ${x.m1()}/}}; new Y()')\n " +
712+ "semaphore('wait')\n " +
713+ "y.x = x\n " +
714+ "echo(/received ${y.m2()}/)\n " , true ));
715+ WorkflowRun b = p .scheduleBuild2 (0 ).waitForStart ();
716+ SemaphoreStep .waitForStart ("wait/1" , b );
717+ });
718+ sessions .then (r -> {
719+ WorkflowJob p = r .jenkins .getItemByFullName ("p" , WorkflowJob .class );
720+ WorkflowRun b = p .getLastBuild ();
721+ SemaphoreStep .success ("wait/1" , null );
722+ r .assertLogContains ("received really OK" , r .assertBuildStatus (Result .SUCCESS , r .waitForCompletion (b )));
723+ });
724+ }
725+
706726 @ Issue ({ "JENKINS-45327" , "JENKINS-68849" })
707727 @ Test public void envActionImplPickle () throws Throwable {
708728 sessions .then (r -> {
You can’t perform that action at this time.
0 commit comments