gaogaotiantian commented on code in PR #56676:
URL: https://github.com/apache/spark/pull/56676#discussion_r3455788170


##########
python/pyspark/resource/tests/test_connect_resources.py:
##########
@@ -46,6 +46,17 @@ def test_profile_before_sc_for_connect(self):
         ).getOrCreate()
         # Still can access taskResources, similar to executorResources.
         self.assertEqual(rp.taskResources["cpus"].amount, 2.0)
+        # SPARK-57615: the local-cluster Spark Connect server can return 
errors on the first
+        # commands right after start-connect-server.sh returns, before its 
SparkContext is fully
+        # initialized. Wait until a trivial job succeeds before creating a 
ResourceProfile, which
+        # would otherwise race that initialization and fail server-side.
+        from pyspark.testing.utils import eventually
+
+        def _server_ready() -> bool:
+            spark.range(1).count()
+            return True
+
+        eventually(timeout=120, 
expected_exceptions=(Exception,))(_server_ready)()

Review Comment:
   Oh so the dumped stack trace is not enough? `pystack` worked right?



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