Github user JoshRosen commented on a diff in the pull request:
https://github.com/apache/spark/pull/4135#discussion_r26727249
--- Diff:
streaming/src/test/scala/org/apache/spark/streaming/ReceiverSuite.scala ---
@@ -296,6 +335,27 @@ class ReceiverSuite extends TestSuiteBase with
Timeouts with Serializable {
}
/**
+ * An implementation of Task running a NetworkReceiver used for testing
whether
+ * we can start/stop receiver properly.
+ */
+ class FakeReceiverTask(
+ stageId: Int,
+ executor: FakeReceiverSupervisor,
+ prefLocs: Seq[TaskLocation] = Nil) extends Task[Unit](stageId, 0) {
+ override def runTask(context: TaskContext): Unit = {
+ context.addTaskInterruptedListener { context =>
--- End diff --
I notice that this test harness the logic from the real receiver tracker.
Is this test suite actually covering the changes made to ReceiverTracker? In
other words, if I were to go in and delete the callback registration code that
you added to the real tracker, would that cause any tests to fail? If not,
then I think we need to do additional work to test this, since the test isn't
really testing anything if it can't expose bugs in the real code.
It seems like we'd like to test against a real ReceiverTracker using mock
implementations of ReceiverSupervisor and Receiver. I'm not super-familiar
with this corner of the streaming code, though, so maybe @tdas can chime in
with suggestions on how to test this?
---
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]