Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-63978

Powershell script will hang in pipeline

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None

      I'm a game developer using Unity.

      My main purpose of using Jenkins is to do some resources check / build / automated test daily.

      I use pipeline to seperate all these steps into continuous stages(no parallel). I call powershell script that is uploaded to svn in the stage and all actual content is inside the script. In the script I'll call regular powershell command/Unity/other exe.

      The weird thing is that occasionally the powershell will hang after Unity exiting successfully, and I checked the Unity's log there is no error. I tried many times running the powershell script directly without Jenkins, it all exited correctly with no hang.

      Powershell commands and other exes are fine, other exes I use are really simple compared to the Unity editor.

      Since this is not a bug that appears every time, I really have no idea how to fix it.

       

      This is the stage that will hang

       

      stage('Build'){
          options{
              timeout(time: 60, unit: "MINUTES")
          }
          steps{
              echo "build start..."
              pwsh("&\"${ScriptPath}/Build.ps1\"")
              echo "build finish"
          }
      }
      

       This is the content inside Build.ps1

      # prepare befor build... 
      Start-Process -FilePath "$UnityEditorPath" -ArgumentList "-batchmode -projectPath ""$ProjectPath"" -nographics -executeMethod CI.Editor.CICalls.DoBuild -buildTarget ""${env:Platform}"" -logfile ""$LogPath"" -quit" -Wait
      # generate report after build...

       I added some echo before and after build so I'm sure when it hangs, the content after build is never executed. And the build is always successful(no error in Unity's log and the result package can be found).

       

       

       

            Unassigned Unassigned
            axelhu Axel Hu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: