diff --git a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SQLOperationListenerSuite.scala b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SQLOperationListenerSuite.scala index f3bf6f311ec..f732f7c3846 100644 --- a/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SQLOperationListenerSuite.scala +++ b/externals/kyuubi-spark-sql-engine/src/test/scala/org/apache/spark/kyuubi/SQLOperationListenerSuite.scala @@ -35,8 +35,8 @@ class SQLOperationListenerSuite extends WithSparkSQLEngine with HiveJDBCTestHelp override protected def jdbcUrl: String = getJdbcUrl - test("operation listener with progress job info") { - val sql = "SELECT java_method('java.lang.Thread', 'sleep', 10000l) FROM range(1, 3, 1, 2);" + test("operation listener") { + val sql = "select /*+ REPARTITION(3, a) */ a from values(1) t(a);" withSessionHandle { (client, handle) => val req = new TExecuteStatementReq() req.setSessionHandle(handle) @@ -48,13 +48,17 @@ class SQLOperationListenerSuite extends WithSparkSQLEngine with HiveJDBCTestHelp eventually(timeout(90.seconds), interval(500.milliseconds)) { val resultsResp = client.FetchResults(fetchResultsReq) val logs = resultsResp.getResults.getColumns.get(0).getStringVal.getValues.asScala - assert(logs.exists(_.matches(".*\\[Job .* Stages\\] \\[Stage .*\\]"))) + assert(logs.exists(_.contains("started with 2 stages"))) + assert(logs.exists(_.contains("started with 1 tasks"))) + assert(logs.exists(_.contains("started with 3 tasks"))) + assert(logs.exists(_.contains("Finished stage:"))) + assert(logs.exists(_.contains(s"Job ${0 + initJobId} succeeded"))) } } } - test("operation listener") { - val sql = "select /*+ REPARTITION(3, a) */ a from values(1) t(a);" + test("operation listener with progress job info") { + val sql = "SELECT java_method('java.lang.Thread', 'sleep', 10000l) FROM range(1, 3, 1, 2);" withSessionHandle { (client, handle) => val req = new TExecuteStatementReq() req.setSessionHandle(handle) @@ -66,11 +70,7 @@ class SQLOperationListenerSuite extends WithSparkSQLEngine with HiveJDBCTestHelp eventually(timeout(90.seconds), interval(500.milliseconds)) { val resultsResp = client.FetchResults(fetchResultsReq) val logs = resultsResp.getResults.getColumns.get(0).getStringVal.getValues.asScala - assert(logs.exists(_.contains("started with 2 stages"))) - assert(logs.exists(_.contains("started with 1 tasks"))) - assert(logs.exists(_.contains("started with 3 tasks"))) - assert(logs.exists(_.contains("Finished stage:"))) - assert(logs.exists(_.contains(s"Job ${0 + initJobId} succeeded"))) + assert(logs.exists(_.matches(".*\\[Job .* Stages\\] \\[Stage .*\\]"))) } } }