Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/16426#discussion_r94282611
--- Diff: core/src/test/scala/org/apache/spark/SparkContextSuite.scala ---
@@ -465,6 +465,8 @@ class SparkContextSuite extends SparkFunSuite with
LocalSparkContext {
sc.removeSparkListener(sparkListener1)
assert(!sc.listenerBus.listeners.contains(sparkListener1))
assert(sc.listenerBus.listeners.contains(sparkListener2))
+ } finally {
--- End diff --
Ah, I just remembered: `LocalSparkContext` is actually managing `sc` for
every test, including stopping it after it finishes. So this particular change
isn't needed, but, the problem is that the `sc` managed for this test is
ignored and never closed because it's discarded in the first line. If anything,
for tidiness, `sc.stop()` needs to be the first line.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]