HyukjinKwon commented on a change in pull request #23435: [SPARK-25921][Follow 
Up][PySpark] Fix barrier task run without BarrierTaskContext while python 
worker reuse
URL: https://github.com/apache/spark/pull/23435#discussion_r244928489
 
 

 ##########
 File path: python/pyspark/tests/test_taskcontext.py
 ##########
 @@ -149,6 +134,44 @@ def f(iterator):
         self.assertTrue(len(taskInfos[0]) == 4)
 
 
+class TaskContextTestsWithWorkerReuse(PySparkTestCase):
+
+    def setUp(self):
+        self._old_sys_path = list(sys.path)
+        class_name = self.__class__.__name__
+        conf = SparkConf().set("spark.python.worker.reuse", "true")
+        self.sc = SparkContext('local[2]', class_name, conf=conf)
+
+    def test_barrier_with_python_worker_reuse(self):
+        """
+        Regression test for SPARK-25921: verify that 
BarrierTaskContext.barrier() with
+        reused python worker.
+        """
+        import os
 
 Review comment:
   I think it's okie to import it on the top of this file

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to