skonto commented on a change in pull request #23514: [SPARK-24902][K8s] Add PV 
integration tests
URL: https://github.com/apache/spark/pull/23514#discussion_r252064271
 
 

 ##########
 File path: 
examples/src/main/scala/org/apache/spark/examples/DFSReadWriteTest.scala
 ##########
 @@ -107,6 +110,13 @@ object DFSReadWriteTest {
 
     println("Writing local file to DFS")
     val dfsFilename = s"$dfsDirPath/dfs_read_write_test"
+
+    // delete file if exists
+    val fs = FileSystem.get(spark.sessionState.newHadoopConf())
+    if (fs.exists(new Path(dfsFilename))) {
+        fs.delete(new Path(dfsFilename), true)
+    }
+
 
 Review comment:
   I need to delete the file upfront, otherwise if it is already there due to a 
previous run, tests will fail. 
   I cannot delete it from within the test suite because permissions are 
185:root. 
   So I have to delete it from Spark.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to