Skip to content

Commit 99e416b

Browse files
lianchengmengxr
authored andcommitted
[SQL] Fixes the race condition that may cause test failure
The removed `Future` was used to end the test case as soon as the Spark SQL CLI process exits. When the process exits prematurely, this mechanism prevents the test case to wait until timeout. But it also creates a race condition: when `foundAllExpectedAnswers.tryFailure` is called, there are chances that the last expected output line of the CLI process hasn't been caught by the main logics of the test code, thus fails the test case. Removing this `Future` doesn't affect correctness. Author: Cheng Lian <[email protected]> Closes #2823 from liancheng/clean-clisuite and squashes the following commits: 489a97c [Cheng Lian] Fixes the race condition that may cause test failure
1 parent 091d32c commit 99e416b

File tree

1 file changed

+0
-6
lines changed
  • sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver

1 file changed

+0
-6
lines changed

sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,6 @@ class CliSuite extends FunSuite with BeforeAndAfterAll with Logging {
7878
val process = (Process(command) #< queryStream).run(
7979
ProcessLogger(captureOutput("stdout"), captureOutput("stderr")))
8080

81-
Future {
82-
val exitValue = process.exitValue()
83-
foundAllExpectedAnswers.tryFailure(
84-
new SparkException(s"Spark SQL CLI process exit value: $exitValue"))
85-
}
86-
8781
try {
8882
Await.result(foundAllExpectedAnswers.future, timeout)
8983
} catch { case cause: Throwable =>

0 commit comments

Comments
 (0)