HyukjinKwon commented on code in PR #56676:
URL: https://github.com/apache/spark/pull/56676#discussion_r3455813998
##########
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:
It runs a separate server so the output better has to be thrown to the
console which should be easier. Anyway, this fix is both for debugging and
actual fixing :-). Should be fine
--
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]