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 @@ -692,6 +692,26 @@ public boolean isAllowed(String groovyResourceUrl) {
692692 }
693693 }
694694
695+ @ Test public void evaluateAfterRestart () throws Throwable {
696+ sessions .then (r -> {
697+ WorkflowJob p = r .createProject (WorkflowJob .class , "p" );
698+ p .setDefinition (new CpsFlowDefinition (
699+ "def x = evaluate('class X {X() {}; def m1() {/OK/}}; new X()')\n " +
700+ "def y = evaluate('class Y {X x; def m2() {/really ${x.m1()}/}}; new Y()')\n " +
701+ "semaphore('wait')\n " +
702+ "y.x = x\n " +
703+ "echo(/received ${y.m2()}/)\n " , true ));
704+ WorkflowRun b = p .scheduleBuild2 (0 ).waitForStart ();
705+ SemaphoreStep .waitForStart ("wait/1" , b );
706+ });
707+ sessions .then (r -> {
708+ WorkflowJob p = r .jenkins .getItemByFullName ("p" , WorkflowJob .class );
709+ WorkflowRun b = p .getLastBuild ();
710+ SemaphoreStep .success ("wait/1" , null );
711+ r .assertLogContains ("received really OK" , r .assertBuildStatus (Result .SUCCESS , r .waitForCompletion (b )));
712+ });
713+ }
714+
695715 @ Issue ({ "JENKINS-45327" , "JENKINS-68849" })
696716 @ Test public void envActionImplPickle () throws Throwable {
697717 sessions .then (r -> {
You can’t perform that action at this time.
0 commit comments