Skip to content
Merged
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 @@ -373,6 +373,7 @@ class CometIcebergRewriteActionSuite extends CometTestBase with CometIcebergTest
case _ =>
}
}
CometListenerBusUtils.waitUntilEmpty(spark.sparkContext)
spark.sparkContext.addSparkListener(listener)
try {
body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ trait CometIcebergTestBase { this: CometTestBase =>
override def onFailure(funcName: String, qe: QueryExecution, exception: Exception): Unit =
if (includeFailures) captured += qe.executedPlan
}
// Events from earlier queries may still be queued; drain them so they do not reach the
// listener.
CometListenerBusUtils.waitUntilEmpty(spark.sparkContext)
spark.listenerManager.register(listener)
try {
action
Expand All @@ -259,6 +262,7 @@ trait CometIcebergTestBase { this: CometTestBase =>
override def onFailure(funcName: String, qe: QueryExecution, exception: Exception): Unit =
captured += qe.executedPlan
}
CometListenerBusUtils.waitUntilEmpty(spark.sparkContext)
spark.listenerManager.register(listener)
try {
val error =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3411,6 +3411,8 @@ class CometIcebergWriteActionSuite
override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit =
if (taskEnd.reason == Success) JobAbortGate.taskFinished()
}
// Drain the setup writes' task-end events first, or they can count toward the gate.
CometListenerBusUtils.waitUntilEmpty(spark.sparkContext)
spark.sparkContext.addSparkListener(listener)
try {
val run = () =>
Expand Down Expand Up @@ -4309,6 +4311,8 @@ class CometIcebergWriteActionSuite
val listener = new IcebergWriteReportListener(
new SparkConf()
.set(CometConf.COMET_ICEBERG_WRITE_REPORT_DIR.key, reportDir.getAbsolutePath))
// Drain the setup writes' events first, or they can reach the listener and be reported.
CometListenerBusUtils.waitUntilEmpty(spark.sparkContext)
spark.listenerManager.register(listener)
try {
action
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ object CometIcebergWriteBenchmark extends CometBenchmarkBase {
qe: QueryExecution,
exception: Exception): Unit = {}
}
CometListenerBusUtils.waitUntilEmpty(spark.sparkContext)
spark.listenerManager.register(listener)
try {
action
Expand Down
Loading