viirya commented on a change in pull request #33239: URL: https://github.com/apache/spark/pull/33239#discussion_r672584143
########## File path: sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala ########## @@ -852,6 +857,33 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils assert(metrics.contains(expectedMetric.id)) assert(metrics(expectedMetric.id) === expectedValue) } + + test("SPARK-36030: Report metrics from Datasource v2 write") { + withTempDir { dir => + val statusStore = spark.sharedState.statusStore + val oldCount = statusStore.executionsList().size + + val cls = classOf[CustomMetricsDataSource].getName + spark.range(10).select('id as 'i, -'id as 'j).write.format(cls) + .option("path", dir.getCanonicalPath).mode("append").save() + + // Wait until the new execution is started and being tracked. + while (statusStore.executionsCount() < oldCount) { Review comment: Switched to `eventually`. Thanks. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org