Github user markhamstra commented on a diff in the pull request:
https://github.com/apache/spark/pull/186#discussion_r11410721
--- Diff:
core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala ---
@@ -17,29 +17,32 @@
package org.apache.spark.scheduler
-import scala.Tuple2
import scala.collection.mutable.{HashMap, Map}
+import scala.Tuple2
+import akka.actor._
+import akka.testkit.{TestKit, ImplicitSender, TestActorRef}
import org.scalatest.{BeforeAndAfter, FunSuite}
+import org.scalatest.matchers.MustMatchers
import org.apache.spark._
import org.apache.spark.rdd.RDD
import org.apache.spark.scheduler.SchedulingMode.SchedulingMode
import org.apache.spark.storage.{BlockId, BlockManagerId,
BlockManagerMaster}
-/**
- * Tests for DAGScheduler. These tests directly call the event processing
functions in DAGScheduler
- * rather than spawning an event loop thread as happens in the real code.
They use EasyMock
- * to mock out two classes that DAGScheduler interacts with: TaskScheduler
(to which TaskSets are
- * submitted) and BlockManagerMaster (from which cache locations are
retrieved and to which dead
- * host notifications are sent). In addition, tests may check for side
effects on a non-mocked
- * MapOutputTracker instance.
- *
- * Tests primarily consist of running DAGScheduler#processEvent and
- * DAGScheduler#submitWaitingStages (via test utility functions like
runEvent or respondToTaskSet)
- * and capturing the resulting TaskSets from the mock TaskScheduler.
- */
-class DAGSchedulerSuite extends FunSuite with BeforeAndAfter with
LocalSparkContext {
+class BuggyDAGEventProcessActor extends Actor {
+ val state = 0
+ def receive = {
+ case _ => throw new SparkException("error")
+ }
+}
+
+class DAGSchedulerSuite(_system: ActorSystem)
+ extends TestKit(_system) with FunSuite with MustMatchers
--- End diff --
Don't copy the Akka doc's usage of `_system` -- we try to avoid using
underscores in names since they don't usually contribute much and underscores
are already so heavily overloaded in Scala.
---
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.
---