Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/21758#discussion_r202856422
  
    --- Diff: core/src/test/scala/org/apache/spark/SparkContextSuite.scala ---
    @@ -627,6 +627,48 @@ class SparkContextSuite extends SparkFunSuite with 
LocalSparkContext with Eventu
         assert(exc.getCause() != null)
         stream.close()
       }
    +
    +  test("support barrier sync under local mode") {
    +    val conf = new SparkConf().setAppName("test").setMaster("local[2]")
    +    sc = new SparkContext(conf)
    +    val rdd = sc.makeRDD(Seq(1, 2, 3, 4), 2)
    +    val rdd2 = rdd.barrier().mapPartitions { (it, context) =>
    +      // If we don't get the expected taskInfos, the job shall abort due 
to stage failure.
    +      if (context.getTaskInfos().length != 2) {
    +        throw new SparkException("Expected taksInfos length is 2, actual 
length is " +
    +          s"${context.getTaskInfos().length}.")
    +      }
    +      context.barrier()
    +      it
    +    }
    +    rdd2.collect
    --- End diff --
    
    minor: `collect()`


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to