Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/19893#discussion_r155366220
--- Diff: core/src/test/scala/org/apache/spark/SparkFunSuite.scala ---
@@ -52,6 +62,23 @@ abstract class SparkFunSuite
getTestResourceFile(file).getCanonicalPath
}
+ private def saveThreadNames(): Unit = {
+ beforeAllTestThreadNames =
Thread.getAllStackTraces.keySet().map(_.getName).toSet
+ }
+
+ private def printRemainingThreadNames(): Unit = {
+ val currentThreadNames =
Thread.getAllStackTraces.keySet().map(_.getName).toSet
+ val whitelistedThreadNames = currentThreadNames.
+ filterNot(s => SparkFunSuite.threadWhiteList.exists(s.matches(_)))
+ val remainingThreadNames =
whitelistedThreadNames.diff(beforeAllTestThreadNames)
+ if (!remainingThreadNames.isEmpty) {
--- End diff --
`remainingThreadNames.nonEmpty`
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]