Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,23 +59,21 @@ object IntegrationTestUtils {
s"$connectClientHomeDir/target/$scalaDir/test-classes"
}

private[sql] def debugConfigs: Seq[String] = {
private[sql] def log4jConfigs: Seq[String] = {
val log4j2 = s"$connectClientHomeDir/src/test/resources/log4j2.properties"
if (isDebug) {
Seq(
// Enable to see the server plan change log
// "--conf",
// "spark.sql.planChangeLog.level=WARN",

// Enable to see the server grpc received
// "--conf",
// "spark.connect.grpc.interceptor.classes=" +
// "org.apache.spark.sql.connect.service.LoggingInterceptor",

// Redirect server log into console
"--conf",
s"spark.driver.extraJavaOptions=-Dlog4j.configurationFile=$log4j2")
} else Seq.empty
Seq(
// Enable to see the server plan change log
// "--conf",
// "spark.sql.planChangeLog.level=WARN",

// Enable to see the server grpc received
// "--conf",
// "spark.connect.grpc.interceptor.classes=" +
// "org.apache.spark.sql.connect.service.LoggingInterceptor",

// Redirect server log into console
"--conf",
s"spark.driver.extraJavaOptions=-Dlog4j.configurationFile=$log4j2")
}

// Log server start stop debug info into console
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ object SparkConnectServerUtils {
command += "--jars" += catalystTestJar
command += "--conf" += s"spark.connect.grpc.binding.port=$port"
command ++= testConfigs
command ++= debugConfigs
command ++= log4jConfigs
command += connectJar
val cmds = command.result()
debug {
Expand All @@ -90,15 +90,8 @@ object SparkConnectServerUtils {
builder.directory(new File(sparkHome))
val environment = builder.environment()
environment.remove("SPARK_DIST_CLASSPATH")
if (isDebug) {
builder.redirectError(Redirect.INHERIT)
builder.redirectOutput(Redirect.INHERIT)
} else {
// If output is not consumed, the stdout/stderr pipe buffers will fill up,
// causing the server process to block on write() calls
builder.redirectError(Redirect.DISCARD)
builder.redirectOutput(Redirect.DISCARD)
}
builder.redirectError(Redirect.INHERIT)
builder.redirectOutput(Redirect.INHERIT)

val process = builder.start()
consoleOut = process.getOutputStream
Expand Down