WeichenXu123 commented on pull request #28584:
URL: https://github.com/apache/spark/pull/28584#issuecomment-631859882


   Also fix this test like:
   ```
     test("share messages with allGather() call") {
       val conf = new SparkConf()
         .setMaster("local-cluster[4, 1, 1024]")
         .setAppName("test-cluster")
       sc = new SparkContext(conf)
       val rdd = sc.makeRDD(1 to 4, 4)
       val rdd2 = rdd.barrier().mapPartitions { it =>
         val context = BarrierTaskContext.get()
         // Sleep for a random time before global sync.
         Thread.sleep(Random.nextInt(1000))
         // Pass partitionId message in
         val message: String = context.partitionId().toString
         val messages: Array[String] = context.allGather(message)
         Iterator.single(messages.toList)
       }
       // Take a sorted list of all the partitionId messages
       val messages_list = rdd2.collect()
       assert (messages_list.length === 4)
       for (messages <- messages_list) {
         assert (messages === (0 until 4).map(_.toString).toList)
       }
     }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to