java.util.concurrent.ExecutionException: java.util.concurrent.RejectedExecutionException
      	at com.google.common.util.concurrent.AbstractFuture$Sync.getValue(AbstractFuture.java:289)
      	at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:276)
      	at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111)
      	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.waitForSuspension(CpsFlowExecution.java:780)
      	at org.jenkinsci.plugins.workflow.cps.CpsScriptTest.methodNameClash(CpsScriptTest.java:84)
      	at ...
      Caused by: java.util.concurrent.RejectedExecutionException
      	at hudson.remoting.SingleLaneExecutorService.execute(SingleLaneExecutorService.java:100)
      	at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
      	at com.google.common.util.concurrent.ForwardingExecutorService.submit(ForwardingExecutorService.java:110)
      	at jenkins.util.InterceptingExecutorService.submit(InterceptingExecutorService.java:49)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:252)
      	at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$2.call(CpsThreadGroup.java:230)
      	at org.jenkinsci.plugins.workflow.cps.CpsVmExecutorService$2.call(CpsVmExecutorService.java:64)
      	at ...
      

      from this.

      I am inclined to just deprecate waitForSuspension in favor of SemaphoreStep. It is mostly only a few really old tests which still use it. There are some tricky places like CpsFlowExecutionTest.quietDown (for which see JENKINS-46074).

          [JENKINS-46073] Test flake in CpsScriptTest.methodNameClash

          Andrew Bayer added a comment -

          Yeah, I'm not even clear on what waitForSuspension is meant to be doing here.

          Andrew Bayer added a comment - Yeah, I'm not even clear on what waitForSuspension is meant to be doing here.

          Jesse Glick added a comment -

          Without doing something the test will fail since the build will not be done yet.

          For these old tests that is tricky. All new tests just create an actual job and use JenkinsRule.buildAndAssertSuccess or similar. AbstractCpsFlowTest however does some mocky stuff which blocks us from using regular test framework utilities. Would be simplest just to move the test out of this suite and into a a regular one.

          Jesse Glick added a comment - Without doing something the test will fail since the build will not be done yet. For these old tests that is tricky. All new tests just create an actual job and use JenkinsRule.buildAndAssertSuccess or similar. AbstractCpsFlowTest however does some mocky stuff which blocks us from using regular test framework utilities. Would be simplest just to move the test out of this suite and into a a regular one.

            Unassigned Unassigned
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: