Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/17987#discussion_r116532209
  
    --- Diff: core/src/test/scala/org/apache/spark/storage/LocalDirsSuite.scala 
---
    @@ -37,27 +37,50 @@ class LocalDirsSuite extends SparkFunSuite with 
BeforeAndAfter {
         Utils.clearLocalRootDirs()
       }
     
    +  private def assumeNonExistentAndNotCreatable(f: File): Unit = {
    +    try {
    +      assume(!f.exists() && !f.mkdirs())
    +    } finally {
    +      Utils.deleteRecursively(f)
    +    }
    +  }
    +
       test("Utils.getLocalDir() returns a valid directory, even if some local 
dirs are missing") {
    --- End diff --
    
    The problem here is, `Utils.getLocalDir` -> 
`Utils.getOrCreateLocalRootDirs` actually creates the directory. So, even if 
the path does not exist, this can be created. I believe the not existing 
directory are not created under the root in the most cases. However, on 
Windows, it is arguably more possible (at least it seems working in AppVeyor) 
as it creates the directory under `C:` as below:
    
    ```scala
    scala> val a = new java.io.File("/NENEXISTENT_PATH")
    a: java.io.File = \NENEXISTENT_PATH
    
    scala> a.exists()
    res3: Boolean = false
    
    scala> a.mkdirs()
    res4: Boolean = true
    ```


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to