[LIVY-1086][TEST] Pin Spark driver to loopback in remaining macOS test fixtures - #555
nileshrathi345 wants to merge 1 commit into
Conversation
|
Thanks a lot for this follow-up PR. On my end, I had this set in my environment variables, which is why I didn't notice it: It seems like it's still not quite working on macOS, because when I run this for example, I get an error like this: |
Extend the LIVY-1065 macOS test fixes by binding Spark's driver host and bind address to TestUtils.TEST_BIND_HOST in test fixtures that start Spark directly (REPL interpreter/session specs, RSC client, Scala API client, interactive server tests, Thrift server JDBC sessions, and MiniCluster).
a776fbd to
e02a1ea
Compare
|
Thanks for your contribution @nileshrathi345 ! I am still going through the changes, but in the meantime, could you please create a new JIRA for this? It seems extensive enough to have its own ticket. |
Tested complete unit and integration tests and pushed changes $ mvn -Pthriftserver -B verify |
Sure, I have created new Jira for this: https://issues.apache.org/jira/browse/LIVY-1086 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #555 +/- ##
=============================================
- Coverage 68.68% 53.10% -15.58%
+ Complexity 1218 849 -369
=============================================
Files 106 106
Lines 6815 6871 +56
Branches 836 842 +6
=============================================
- Hits 4681 3649 -1032
- Misses 1666 2777 +1111
+ Partials 468 445 -23 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Extend the LIVY-1065 macOS test fixes by binding Spark's driver host and bind address to TestUtils.TEST_BIND_HOST in test fixtures that start Spark directly (REPL interpreter/session specs, RSC client, Scala API client, interactive server tests, Thrift server JDBC sessions, and MiniCluster).
What changes were proposed in this pull request?
This is a follow-up to #538
PR #538 introduced
TestUtils.TEST_BIND_HOSTand pinned Livy, RSC, YARN mini-cluster, and several unit-test services to loopback (127.0.0.1) so tests pass on macOS. However, some unit tests still start Spark directly without settingspark.driver.hostandspark.driver.bindAddress. On macOS, Spark's driver can advertise the machine's LAN IP (fromInetAddress.getLocalHost()), which peer processes on the same host cannot reach, causing connect timeouts and stage failures (e.g.Failed to connect to /192.168.x.x:...).This PR extends the LIVY-1065 fix by:
client-common/TestUtils.java: AddSPARK_DRIVER_HOSTandSPARK_DRIVER_BIND_ADDRESSconstants so Spark driver config keys are not duplicated as raw strings across modules (same pattern asTEST_BIND_HOST).Unit-test fixtures:Setspark.driver.hostandspark.driver.bindAddresstoTestUtils.TEST_BIND_HOSTin fixtures that create Spark sessions/drivers directly:repl:BaseSessionSpec,SessionSpec,ReplDriverSuite,PythonInterpreterSpec,ScalaInterpreterSpec,SQLInterpreterSpec,SparkRInterpreterSpecrsc:TestSparkClientscala-api:ScalaClientTestserver:BaseInteractiveServletSpec,InteractiveSessionSpecthriftserver:ThriftServerBaseTest(inject driver host/bind via JDBC session conf injdbcUri())integration-test/MiniCluster.scala: UseTestUtils.SPARK_DRIVER_HOSTinstead of a hardcoded"spark.driver.host"key string (value remainsTEST_BIND_HOSTfrom #538).Together with #538, this ensures both Livy/RSC services and Spark driver processes started from tests bind/advertise a locally reachable loopback address on macOS. Linux CI behavior is unchanged.
JIRA: https://issues.apache.org/jira/browse/LIVY-1086
How was this patch tested?
Tested locally on macOS (aarch64, JDK 17):
`$ mvn -Pthriftserver -B verify
...
Was this patch authored or co-authored using generative AI tooling?
Coauthored-by: Claude Code (Opus 4.8)