Commit 0790fff
[SPARK-54551][CONNECT][TESTS][FOLLOWUP] Redirect Test Spark connect server output stream to files
### What changes were proposed in this pull request?
Currently, the Spark Connect test server's stdout and stderr are discarded when SPARK_DEBUG_SC_JVM_CLIENT=false, making it difficult to debug test failures.
This PR enables log4j logging for Test Spark Connect server in all test modes (both debug and non-debug) by always configuring log4j2.properties.
### Why are the changes needed?
When `SPARK_DEBUG_SC_JVM_CLIENT=false`
SparkConnectJdbcDataTypeSuite randomly hangs because the child server process blocks on write() calls when stdout/stderr pipe buffers fill up. Without consuming the output, the buffers reach capacity and cause the process to block indefinitely.
Instead of `Redirect.DISCARD` , redirect the logs into log4j files
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Tested and confirmed that log files are created when
1) `SPARK_DEBUG_SC_JVM_CLIENT=false build/sbt "connect-client-jdbc/testOnly org.apache.spark.sql.connect.client.jdbc.SparkConnectJdbcDataTypeSuite"`
OR
2) `SPARK_DEBUG_SC_JVM_CLIENT=true build/sbt "connect-client-jdbc/testOnly org.apache.spark.sql.connect.client.jdbc.SparkConnectJdbcDataTypeSuite"`
```
In this file
./target/unit-tests.log
```
### Was this patch authored or co-authored using generative AI tooling?
No.
Closes #53275 from vinodkc/br_redirect_stdout_stderr_to_file.
Authored-by: vinodkc <vinod.kc.in@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>1 parent 095c2c3 commit 0790fff
File tree
2 files changed
+17
-26
lines changed- sql/connect/client/jvm/src/test/scala/org/apache/spark/sql/connect/test
2 files changed
+17
-26
lines changedsql/connect/client/jvm/src/test/scala/org/apache/spark/sql/connect/test/IntegrationTestUtils.scala
Lines changed: 14 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
| |||
Lines changed: 3 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 93 | + | |
| 94 | + | |
102 | 95 | | |
103 | 96 | | |
104 | 97 | | |
| |||
0 commit comments