Changing the script to following (note the added "exit" stage) seems to fix the problem.

def sleep60 () {
    ws {
        sh "echo ${env.HOSTNAME}"
        stage name: "Sleeping for 60 secs", concurrency: 1
        sh "sleep 60"
        stage name: "Sleep finished" // exit stage to clear stage concurrency related state 
    }
}

The error appears to be due to the last stage being the same name as the previous one so effectively we get 2 stages with the same name within the same flow, albeit in parallel closures.

Still not sure whether the reported issue is a real bug, or not. It would be nice not to need to inject stages in this way and for stage related state to be cleared at the end of a closure?

Note also that I had to change the name of the stage because there was a zombie "Sleep for 60 secs" stage still running! The doDelete trick didn't seem to clear it either so that's a secondary (probably more generic?) problem with being able to zap state from failed/hanging jobs.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to