File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
core/src/test/scala/org/apache/spark/scheduler Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -784,6 +784,21 @@ class DAGSchedulerSuite
784784 assert(sc.parallelize(1 to 10 , 2 ).first() === 1 )
785785 }
786786
787+ test(" getPartitions exceptions should not crash DAGScheduler and SparkContext (SPARK-8606)" ) {
788+ val e1 = intercept[DAGSchedulerSuiteDummyException ] {
789+ val rdd = new MyRDD (sc, 2 , Nil ) {
790+ override def getPartitions : Array [Partition ] = {
791+ throw new DAGSchedulerSuiteDummyException
792+ }
793+ }
794+ rdd.reduceByKey(_ + _, 1 ).count()
795+ }
796+
797+ // Make sure we can still run local commands as well as cluster commands.
798+ assert(sc.parallelize(1 to 10 , 2 ).count() === 10 )
799+ assert(sc.parallelize(1 to 10 , 2 ).first() === 1 )
800+ }
801+
787802 test(" getPreferredLocations errors should not crash DAGScheduler and SparkContext (SPARK-8606)" ) {
788803 val e1 = intercept[DAGSchedulerSuiteDummyException ] {
789804 val rdd = new MyRDD (sc, 2 , Nil ) {
You can’t perform that action at this time.
0 commit comments