Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/23151#discussion_r237886193
--- Diff: core/src/test/scala/org/apache/spark/SparkFunSuite.scala ---
@@ -105,5 +105,16 @@ abstract class SparkFunSuite
logInfo(s"\n\n===== FINISHED $shortSuiteName: '$testName' =====\n")
}
}
-
+ /**
+ * Creates a temporary directory, which is then passed to `f` and will
be deleted after `f`
+ * returns.
+ *
+ * @todo Probably this method should be moved to a more general place
+ */
+ protected def withCreateTempDir(f: File => Unit): Unit = {
--- End diff --
Yes, it seems like we should be able to use an override. The subclass that
needs to inject an additional method call in the block can call the super
method with a lambda that calls the user-supplied block, then this other
method. It's probably worth whatever surgery is needed to make this clean and
reduce duplication. We already have a lot of "create temp thing" methods all
over.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]