Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/21251#discussion_r186567342
--- Diff:
core/src/test/scala/org/apache/spark/deploy/SparkSubmitUtilsSuite.scala ---
@@ -256,4 +256,20 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with
BeforeAndAfterAll {
assert(jarPath.indexOf("mydep") >= 0, "should find dependency")
}
}
+
+ test("SPARK-10878: test resolution files cleaned after resolving
artifact") {
+ val main = new MavenCoordinate("my.great.lib", "mylib", "0.1")
+
+ IvyTestUtils.withRepository(main, None, None) { repo =>
+ val ivySettings = SparkSubmitUtils.buildIvySettings(Some(repo),
Some(tempIvyPath))
+ val jarPath = SparkSubmitUtils.resolveMavenCoordinates(
+ main.toString,
+ ivySettings,
+ isTest = true)
+ val r = """.*org.apache.spark-spark-submit-parent-.*""".r
+ assert(ivySettings.getDefaultCache.listFiles.map(_.getName)
+ .forall { case n @ r() => false case _ => true },
--- End diff --
nit: I think using `!<list of files>.exists(r.findFirstIn(_).isDefined)`
would be slightly clearer than you version.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]