stage name: 'sync'
node("qisrc") {
echo "before sync"
sh "sleep 10"
echo "after sync"
}
stage name: 'build_and_test', concurrency: 1
node("qisrc") {
stage name: 'build'
echo "before build"
sh "sleep 10"
echo "build 1/3"
sh "sleep 10"
echo "build 2/3"
sh "sleep 10"
echo "build 3/3"
stage name: 'test', concurrency: 1
echo "before test"
sh "sleep 10"
echo "test 1/3"
sh "sleep 10"
echo "test 2/3"
sh "sleep 10"
echo "test 3/3"
}
Started by user admin Running: sync Entering stage sync Proceeding Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow Running: Allocate node : Body : Start Running: Print Message before sync Running: Shell Script [workflow] Running shell script + sleep 10 Running: Print Message after sync Running: Allocate node : Body : End Running: Allocate node : End Running: build_and_test Entering stage build_and_test Proceeding Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow Running: Allocate node : Body : Start Running: build Entering stage build Proceeding Running: Print Message before build Running: Shell Script [workflow] Running shell script + sleep 10 Running: Print Message build 1/3 Running: Shell Script [workflow] Running shell script + sleep 10 Running: Print Message build 2/3 Running: Shell Script [workflow] Running shell script + sleep 10 Running: Print Message build 3/3 Running: test Entering stage test Proceeding Running: Print Message before test Running: Shell Script [workflow] Running shell script + sleep 10 Running: Print Message test 1/3 Running: Shell Script [workflow] Running shell script + sleep 10 Running: Print Message test 2/3 Running: Shell Script [workflow] Running shell script + sleep 10 Running: Print Message test 3/3 Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow Finished: SUCCESS
Started by user admin Running: sync Entering stage sync Proceeding Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow@2 Running: Allocate node : Body : Start Running: Print Message before sync Running: Shell Script [workflow@2] Running shell script + sleep 10 Running: Print Message after sync Running: Allocate node : Body : End Running: Allocate node : End Running: build_and_test Entering stage build_and_test Proceeding Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow@2 Running: Allocate node : Body : Start Running: build Entering stage build Proceeding Running: Print Message before build Running: Shell Script [workflow@2] Running shell script + sleep 10 Running: Print Message build 1/3 Running: Shell Script [workflow@2] Running shell script + sleep 10 Running: Print Message build 2/3 Running: Shell Script [workflow@2] Running shell script + sleep 10 Running: Print Message build 3/3 Running: test Entering stage test Waiting for builds [59] Canceled since #61 got here Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow Superseded by #61 Finished: NOT_BUILT
Started by user admin Running: sync Entering stage sync Proceeding Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow@3 Running: Allocate node : Body : Start Running: Print Message before sync Running: Shell Script [workflow@3] Running shell script + sleep 10 Running: Print Message after sync Running: Allocate node : Body : End Running: Allocate node : End Running: build_and_test Entering stage build_and_test Proceeding Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow@3 Running: Allocate node : Body : Start Running: build Entering stage build Proceeding Running: Print Message before build Running: Shell Script [workflow@3] Running shell script + sleep 10 Running: Print Message build 1/3 Running: Shell Script [workflow@3] Running shell script + sleep 10 Running: Print Message build 2/3 Running: Shell Script [workflow@3] Running shell script + sleep 10 Running: Print Message build 3/3 Running: test Entering stage test Canceling older #60 Waiting for builds [59] Canceled since #62 got here Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow Superseded by #62 Finished: NOT_BUILT
Started by user admin Running: sync Entering stage sync Proceeding Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow@4 Running: Allocate node : Body : Start Running: Print Message before sync Running: Shell Script [workflow@4] Running shell script + sleep 10 Running: Print Message after sync Running: Allocate node : Body : End Running: Allocate node : End Running: build_and_test Entering stage build_and_test Proceeding Running: Allocate node : Start Running on qisrc in /home/jenkins/jenkins/workspace/workflow@4 Running: Allocate node : Body : Start Running: build Entering stage build Proceeding Running: Print Message before build Running: Shell Script [workflow@4] Running shell script + sleep 10Running: Print Message build 1/3 Running: Shell Script[workflow@4] Running shell script + sleep 10Running: Print Message build 2/3 Running: Shell Script [workflow@4] Running shell script+ sleep 10Running: Print Message build 3/3 Running: test Entering stage test Canceling older #61 Waiting for builds [59]Unblocked since #59 finished Running: Print Message before test Running: Shell Script [workflow@4] Running shell script + sleep 10Running: Print Message test 1/3 Running: Shell Script [workflow@4] Running shell script + sleep 10Running: Print Message test 2/3 Running: Shell Script [workflow@4] Running shell script + sleep 10Running: Print Message test 3/3 Running: Allocate node : Body : End Running: Allocate node : End Running: End of Workflow Finished: SUCCESS
Hello,
I'm experimenting with the "stage" command using the flow below, and running the job 4 times in a row (#59, #60, #61, #62).
My test show that the concurrency limit I set for stage 'build_and_test' is not accounted for, but the one for the 'test' stage is (great feature, thanks!).
Maybe limiting concurrency only works within a node scope? Or am I missing something?
Doc is quite sparce regarding the stage command.stage name: 'sync'
node("qisrc") {
echo "before sync"
sh "sleep 10"
echo "after sync"
}
stage name: 'build_and_test', concurrency: 1
node("qisrc") {
stage name: 'build'
echo "before build"
sh "sleep 10"
echo "build 1/3"
sh "sleep 10"
echo "build 2/3"
sh "sleep 10"
echo "build 3/3"
stage name: 'test', concurrency: 1
Canceled since #61 got here
I still wonder wether this is a bug, which I should file, or not.
| Stage | Sync | 'build_and_test', concurrency: 1 | 'test', concurrency: 1 | ||||||
| 26 | Fri Jan 29 16:20:39 UTC 2016 | Fri Jan 29 16:20:40 UTC 2016 | Fri Jan 29 16:21:10 UTC 2016 | Fri Jan 29 16:21:11 UTC 2016 | Fri Jan 29 16:21:41 UTC 2016 | ||||
| 27 | Fri Jan 29 16:20:43 UTC 2016 | Fri Jan 29 16:20:43 UTC 2016 | Fri Jan 29 16:21:14 UTC 2016 | Entering stage test/Waiting for builds [26]/Canceled since #28 got here | |||||
| 28 | Fri Jan 29 16:20:46 UTC 2016 | Fri Jan 29 16:20:47 UTC 2016 | Fri Jan 29 16:21:17 UTC 2016 | Entering stage test/Canceling older #27/Waiting for builds [26]/Canceled since #29 got here | |||||
| 29 | Fri Jan 29 16:20:51 UTC 2016 | Fri Jan 29 16:20:51 UTC 2016 | Fri Jan 29 16:21:22 UTC 2016 | Fri Jan 29 16:21:42 UTC 2016 | Fri Jan 29 16:22:12 UTC 2016 | ||||