title: Jenkins Pipeline - Groovy traverse on pwd() results in java.io.FileNotFoundException
body: <p>I'm trying to traverse through the workspace directory using some groovy code, but the Job fails with <code>java.io.FileNotFoundException: /home/user/JENKINS2_STATE/workspace/job@2</code> even though the directory exists. </p>
  
  <p>Pipeline: </p>
  
  <pre><code>import groovy.io.FileType
  import com.cloudbees.groovy.cps.NonCPS
  
  @NonCPS
  def traverseHelper() {
      new File(pwd()).traverse(type: FileType.FILES) {
          println it.path
      }
  }
  
  pipeline {
      agent any
      stages {
          stage('Build') {
              steps {
                  parallel(
                      "Linux": {
                          node(label: 'lnx') {
                              script {
                                  //checking out from git here
                                  traverseHelper()
                              }
                          }
                      },
                      "Windows": {
                          node(label: 'win') {
                              script {
                                  //do Windows stuff here
                              }
                          }
                      }
                  )
              }
          }
          //other stages here
      }
  }
  </code></pre>
  
  <p>The groovy code works locally (without <code>@NonCPS</code> and replacing <code>pwd()</code> with <code>System.getProperty("user.dir")</code>).</p>