tee on windows results in corrupt files

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      node("A_WINDOWS_NODE") {
          ws("test11") {
              cleanWs()
              tee("a_file") {
                  bat "echo u mama"
                  bat "echo u mama"
              }
          }
      }
      

      When the tee body contains more then one statement, then the file is always corrupted. This means that the file cannot be opened, or deleted until the slave is restarted. This is closely related to JENKINS-54346 but is not the same problem!

      When tee only contains one statement, the problem does not occur

       

      This is a very critical issue because the job will fail the second time on cleanWs() and will continue to fail until the slave is restarted.

       

      The problem does not occur on Linux

       

       

      Splitting the tee comment so it contains only one statement works as well:

      node("wind") {
          cleanWs()
          tee("a_file") {
              bat "echo u mama"
          }
          tee("a_file") {
              bat "echo u mama"
          }
      }
      

       

       

      Notice that on Linux:

      node("master") {
          cleanWs()
          tee("a_file") {
              sh "echo u mama"
              sh "echo u mama"
          }
      }

       

      Leads to a_file having 'Terminated' as last line? Thats also a bit strange

      cat a_file >>
      + echo u mama
      u mama
      + echo u mama
      u mama
      Terminated
      
      
      

            Assignee:
            rsandell
            Reporter:
            roel postelmans
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: