HyukjinKwon commented on code in PR #40793:
URL: https://github.com/apache/spark/pull/40793#discussion_r1168439123


##########
python/pyspark/ml/torch/tests/test_distributor.py:
##########
@@ -382,59 +400,51 @@ def test_end_to_end_run_locally(self) -> None:
 
 @unittest.skipIf(not have_torch, "torch is required")
 class TorchDistributorLocalUnitTests(TorchDistributorLocalUnitTestsMixin, 
unittest.TestCase):
-    def setUp(self) -> None:
-        class_name = self.__class__.__name__
-        conf = self._get_spark_conf()
-        sc = SparkContext("local-cluster[2,2,1024]", class_name, conf=conf)
-        self.spark = SparkSession(sc)
-        self.mnist_dir_path = tempfile.mkdtemp()
+    @classmethod
+    def setUpClass(cls):
+        (gpu_discovery_script_file_name, mnist_dir_path) = set_up_test_dirs()
+        cls.gpu_discovery_script_file_name = gpu_discovery_script_file_name
+        cls.mnist_dir_path = mnist_dir_path

Review Comment:
   ```suggestion
           cls.gpu_discovery_script_file_name = set_up_test_dirs()
   ```



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to