Skip to content

Commit bc537e4

Browse files
zsxwingtdas
authored andcommitted
[SPARK-20957][SS][TESTS] Fix o.a.s.sql.streaming.StreamingQueryManagerSuite listing
## What changes were proposed in this pull request? When stopping StreamingQuery, StreamExecution will set `streamDeathCause` then notify StreamingQueryManager to remove this query. So it's possible that when `q2.exception.isDefined` returns `true`, StreamingQueryManager's active list still has `q2`. This PR just puts the checks into `eventually` to fix the flaky test. ## How was this patch tested? Jenkins Author: Shixiong Zhu <[email protected]> Closes #18180 from zsxwing/SPARK-20957.
1 parent 06c0544 commit bc537e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryManagerSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ class StreamingQueryManagerSuite extends StreamTest with BeforeAndAfter {
7878
eventually(Timeout(streamingTimeout)) {
7979
require(!q2.isActive)
8080
require(q2.exception.isDefined)
81+
assert(spark.streams.get(q2.id) === null)
82+
assert(spark.streams.active.toSet === Set(q3))
8183
}
82-
assert(spark.streams.get(q2.id) === null)
83-
assert(spark.streams.active.toSet === Set(q3))
8484
}
8585
}
8686

0 commit comments

Comments
 (0)