jenkinsci/workflow-plugin — pull request #10 by jglick (2014-08-05 17:36:10+00:00)
Title: Active watches via StepExecutionIterator

Split off from #9 because I could not get tests to pass.

The ignored test in `cps` is expected—a unit test cannot inject a `StepExecutionIterator` that I know of. Could either find some way to inject into an `ExtensionList`, or move this to a functional test in `aggregator`, or just delete if this test is superseded by other tests anyway, as seems likely.

The failure of `WorkflowTest.acquireWorkspace` stumped me, though. It just hangs after restart with this change applied. Thread dumps seem to show a bunch of threads waiting for something I cannot identify:

```
"jenkins.util.Timer [#2]" Id=94 Group=main WAITING on com.google.common.util.concurrent.AbstractFuture$Sync@1b3e8303
at sun.misc.Unsafe.park(Native Method)
- waiting on com.google.common.util.concurrent.AbstractFuture$Sync@1b3e8303
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:275)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111)
at com.google.common.util.concurrent.Futures$ListFuture.callAllGets(Futures.java:1425)
at com.google.common.util.concurrent.Futures$ListFuture.get(Futures.java:1404)
at com.google.common.util.concurrent.Futures$ListFuture.get(Futures.java:1276)
at com.google.common.util.concurrent.Futures$ListFuture.callAllGets(Futures.java:1425)
at com.google.common.util.concurrent.Futures$ListFuture.get(Futures.java:1404)
at com.google.common.util.concurrent.Futures$ListFuture.get(Futures.java:1276)
at org.jenkinsci.plugins.workflow.test.steps.WatchYourStep.update(WatchYourStep.java:58)
at org.jenkinsci.plugins.workflow.test.steps.WatchYourStep$WatchTask.doRun(WatchYourStep.java:125)
at …
Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@61067906
"jenkins.util.Timer [#9]" Id=101 Group=main WAITING on com.google.common.util.concurrent.AbstractFuture$Sync@712344d8
at sun.misc.Unsafe.park(Native Method)
- waiting on com.google.common.util.concurrent.AbstractFuture$Sync@712344d8
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.parkAndCheckInterrupt(AbstractQueuedSynchronizer.java:834)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedInterruptibly(AbstractQueuedSynchronizer.java:994)
at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1303)
at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:275)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:111)
at com.google.common.util.concurrent.Futures$ListFuture.callAllGets(Futures.java:1425)
at com.google.common.util.concurrent.Futures$ListFuture.get(Futures.java:1404)
at com.google.common.util.concurrent.Futures$ListFuture.get(Futures.java:1276)
at com.google.common.util.concurrent.Futures$ListFuture.callAllGets(Futures.java:1425)
at com.google.common.util.concurrent.Futures$ListFuture.get(Futures.java:1404)
at com.google.common.util.concurrent.Futures$ListFuture.get(Futures.java:1276)
at org.jenkinsci.plugins.workflow.steps.durable_task.DurableTaskStep$Checker.doRun(DurableTaskStep.java:158)
at …
Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@4a40807c
"Waiting to acquire /tmp/hudson5863637599749979080test/workspace/demo@3 : jenkins.util.Timer [#6]" Id=98 Group=main WAITING on hudson.slaves.WorkspaceList@427cfaef
at java.lang.Object.wait(Native Method)
- waiting on hudson.slaves.WorkspaceList@427cfaef
at java.lang.Object.wait(Object.java:503)
at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:243)
at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:222)
at hudson.slaves.WorkspaceList.acquire(WorkspaceList.java:211)
at org.jenkinsci.plugins.workflow.support.pickles.WorkspaceListLeasePickle$1.tryResolve(WorkspaceListLeasePickle.java:72)
at org.jenkinsci.plugins.workflow.support.pickles.WorkspaceListLeasePickle$1.tryResolve(WorkspaceListLeasePickle.java:57)
at org.jenkinsci.plugins.workflow.support.pickles.TryRepeatedly$1.run(TryRepeatedly.java:58)
at …
Number of locked synchronizers = 1
- java.util.concurrent.ThreadPoolExecutor$Worker@667e71fe
```