macosjenkinsjenkins-workflowxbuild

Jenkins Workflow sh Step Hanging


I currently have a problem with a shell step in a workflow script hanging. The step appears to complete but the workflow doesn't move on, the Jenkins java process also begins to consume large amounts of CPU.

Jenkins is running on an OS X box and the sh step is a call to xbuild to build a Xamarin app.

    def shell = "xbuild /p:Configuration=${buildConfig} /t:Build ${_solution.getPath()}"

    sh("${shell} >> ${_logFile.getPath()}")

The contents of the log file suggest that xbuild completed succesfully but the workflow never moves on from the sh step.

Could anyone suggest a strategy to find out what is causing it to hang?


Solution

  • This turned out to be caused by a tight loop I had that was executing after the sh step completed.

    My recommendation to anyone else experiencing a problem like this would be to make good use of logging to the console output so you can see exactly where the build is stuck.