Skip to content

Commit f1ffc6e

Browse files
heary-caosrowen
authored andcommitted
[SPARK-20609][CORE] Run the SortShuffleSuite unit tests have residual spark_* system directory
## What changes were proposed in this pull request? This PR solution to run the SortShuffleSuite unit tests have residual spark_* system directory For example: OS:Windows 7 After the running SortShuffleSuite unit tests, the system of TMP directory have '..\AppData\Local\Temp\spark-f64121f9-11b4-4ffd-a4f0-cfca66643503' not deleted ## How was this patch tested? Run SortShuffleSuite unit test. Author: caoxuewen <cao.xuewen@zte.com.cn> Closes apache#17869 from heary-cao/SortShuffleSuite.
1 parent 190d8b0 commit f1ffc6e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/test/scala/org/apache/spark/SortShuffleSuite.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ class SortShuffleSuite extends ShuffleSuite with BeforeAndAfterAll {
3838

3939
override def beforeAll() {
4040
super.beforeAll()
41+
// Once 'spark.local.dir' is set, it is cached. Unless this is manually cleared
42+
// before/after a test, it could return the same directory even if this property
43+
// is configured.
44+
Utils.clearLocalRootDirs()
4145
conf.set("spark.shuffle.manager", "sort")
4246
}
4347

@@ -50,6 +54,7 @@ class SortShuffleSuite extends ShuffleSuite with BeforeAndAfterAll {
5054
override def afterEach(): Unit = {
5155
try {
5256
Utils.deleteRecursively(tempDir)
57+
Utils.clearLocalRootDirs()
5358
} finally {
5459
super.afterEach()
5560
}

0 commit comments

Comments
 (0)