Skip to content

Commit f60772c

Browse files
committed
use different folder for m2 cache during testing
1 parent b6ef038 commit f60772c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,8 +736,14 @@ private[spark] object SparkSubmitUtils {
736736
}
737737

738738
/** Path of the local Maven cache. */
739-
private[spark] def m2Path: File = new File(System.getProperty("user.home"),
740-
".m2" + File.separator + "repository")
739+
private[spark] def m2Path: File = {
740+
if (Utils.isTesting) {
741+
// test builds delete the maven cache, and this can cause flakiness
742+
new File(Utils.createTempDir("mvn2"), ".m2" + File.separator + "repository")
743+
} else {
744+
new File(System.getProperty("user.home"), ".m2" + File.separator + "repository")
745+
}
746+
}
741747

742748
/**
743749
* Extracts maven coordinates from a comma-delimited string

0 commit comments

Comments
 (0)