Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/7250#discussion_r34425833
--- Diff:
streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala
---
@@ -796,3 +821,21 @@ package object testPackage extends Assertions {
}
}
}
+
+/**
+ * Helper methods for testing StreamingContextSuite.
+ * This includes methods to access private methods and fields in
StreamingContext and MetricsSystem.
+ */
+private object StreamingContextSuite extends PrivateMethodTester {
+ private val _sources = PrivateMethod[ArrayBuffer[Source]]('sources)
+ private def getSources(metricsSystem: MetricsSystem):
ArrayBuffer[Source] = {
+ metricsSystem invokePrivate _sources()
--- End diff --
You don't need postfix syntax here;
`metricsSystem.invokePrivate(_sources())` is probably better.
Your test fails because the streaming source isn't present after the
streaming context stops. Isn't that the point? is your test negated?
---
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]