Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/7250#discussion_r34400496
--- Diff:
streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala
---
@@ -297,6 +299,23 @@ class StreamingContextSuite extends SparkFunSuite with
BeforeAndAfter with Timeo
Thread.sleep(100)
}
+ test("registering and de-registering of streamingSource") {
+ val conf = new SparkConf().setMaster(master).setAppName(appName)
+ ssc = new StreamingContext(conf, batchDuration)
+ addInputStream(ssc).register()
+
+ ssc.start()
+ assert(ssc.getState() === StreamingContextState.INITIALIZED)
+
assert(StreamingContextSuite.sources.get(StreamingContextSuite.streamingSource)!=
"null")
--- End diff --
A much nicer way to do this is to do it they way it is done in
https://github.com/apache/spark/blob/master/core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala#L782
using the PrivateTester stuff. Please use that, we want to stay consistent
to the rest of the code base.
---
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]