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


##########
python/pyspark/ml/tests/connect/test_parity_torch_distributor.py:
##########
@@ -107,21 +122,26 @@ def _get_inputs_for_test_local_training_succeeds(self):
 class TorchDistributorDistributedUnitTestsOnConnect(
     TorchDistributorDistributedUnitTestsMixin, unittest.TestCase
 ):
-    def setUp(self) -> None:
-        class_name = self.__class__.__name__
-        conf = self._get_spark_conf()
-        builder = SparkSession.builder.appName(class_name)
-        for k, v in conf.getAll():
-            if k not in ["spark.master", "spark.remote", "spark.app.name"]:
-                builder = builder.config(k, v)
-
-        self.spark = builder.remote("local-cluster[2,2,1024]").getOrCreate()
-        self.mnist_dir_path = tempfile.mkdtemp()
-
-    def tearDown(self) -> None:
-        shutil.rmtree(self.mnist_dir_path)
-        os.unlink(self.gpu_discovery_script_file.name)
-        self.spark.stop()
+    @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
+
+        builder = 
SparkSession.builder.appName("TorchDistributorDistributedUnitTestsOnConnect")

Review Comment:
   ditto



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