The test first create a temporary path by java.nio.Files.createTempDirectory, then delete it, then use the allocated temp path to be the saving path for dataframe.
This is risky. because when we delete a directory, the path is released and can be allocated as new temp dir in other place, which cause the next line df.save (errorIfExisting mode) failed.
So I update the code. Do not delete the created temp dir, but create a sub-dir inside it as the df saving destination.
Fix flaky test "LocalWriteSuite"
The issue is in:
The test first create a temporary path by
java.nio.Files.createTempDirectory
, then delete it, then use the allocated temp path to be the saving path for dataframe. This is risky. because when we delete a directory, the path is released and can be allocated as new temp dir in other place, which cause the next linedf.save
(errorIfExisting mode) failed.So I update the code. Do not delete the created temp dir, but create a sub-dir inside it as the df saving destination.