This is an automated email from the ASF dual-hosted git repository.

chengpan pushed a commit to branch branch-1.8
in repository https://gitbox.apache.org/repos/asf/kyuubi.git


The following commit(s) were added to refs/heads/branch-1.8 by this push:
     new f9556b305 [KYUUBI #5104][TEST] BatchesResourceSuite - expose the 
metrics with operation type and current state
f9556b305 is described below

commit f9556b305eed481d2f035e823c1f4b0dde1c7cfa
Author: sychen <[email protected]>
AuthorDate: Wed Feb 21 09:44:25 2024 +0000

    [KYUUBI #5104][TEST] BatchesResourceSuite - expose the metrics with 
operation type and current state
    
    # :mag: Description
    ## Issue References ๐Ÿ”—
    
    This pull request fixes #5104
    
    ## Describe Your Solution ๐Ÿ”ง
    
    Make sure that the batch is already running before deleting it.
    
    ## Types of changes :bookmark:
    - [x] Bugfix (non-breaking change which fixes an issue)
    - [ ] New feature (non-breaking change which adds functionality)
    - [ ] Breaking change (fix or feature that would cause existing 
functionality to change)
    
    ## Test Plan ๐Ÿงช
    
    #### Behavior Without This Pull Request :coffin:
    GA sometimes fails
    
    #### Behavior With This Pull Request :tada:
    GA success
    
    #### Related Unit Tests
    BatchesV2ResourceSuite
    
    `expose the metrics with operation type and current state`
    
    ---
    
    # Checklist ๐Ÿ“
    
    - [x] This patch was not authored or co-authored using [Generative 
Tooling](https://www.apache.org/legal/generative-tooling.html)
    
    **Be nice. Be informative.**
    
    Closes #6062 from cxzl25/KYUUBI-5104.
    
    Closes #5104
    
    511a0f32d [sychen] trigger test
    38620803e [sychen] trigger test
    1f21003d4 [sychen] trigger test
    292ea91c8 [sychen] DriverSubmissionTest
    bc53d3d10 [sychen] test
    
    Authored-by: sychen <[email protected]>
    Signed-off-by: Cheng Pan <[email protected]>
    (cherry picked from commit fbe80ace11e4049e5a00737a208dfe6f50e3d370)
    Signed-off-by: Cheng Pan <[email protected]>
---
 .../kyuubi/server/api/v1/BatchesResourceSuite.scala    | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git 
a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/BatchesResourceSuite.scala
 
b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/BatchesResourceSuite.scala
index f20c3edda..7f749d8d7 100644
--- 
a/kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/BatchesResourceSuite.scala
+++ 
b/kyuubi-server/src/test/scala/org/apache/kyuubi/server/api/v1/BatchesResourceSuite.scala
@@ -750,9 +750,15 @@ abstract class BatchesResourceSuiteBase extends 
KyuubiFunSuite
         getBatchJobSubmissionStateCounter(OperationState.ERROR)
 
     val batchId = UUID.randomUUID().toString
-    val requestObj = newSparkBatchRequest(Map(
-      "spark.master" -> "local",
-      KYUUBI_BATCH_ID_KEY -> batchId))
+    val requestObj = newBatchRequest(
+      sparkBatchTestBatchType,
+      sparkBatchTestResource.get,
+      "org.apache.spark.examples.DriverSubmissionTest",
+      "DriverSubmissionTest-" + batchId,
+      Map(
+        "spark.master" -> "local",
+        KYUUBI_BATCH_ID_KEY -> batchId),
+      Seq("120"))
 
     eventually(timeout(10.seconds)) {
       val response = webTarget.path("api/v1/batches")
@@ -765,10 +771,8 @@ abstract class BatchesResourceSuiteBase extends 
KyuubiFunSuite
         batch.getState === OperationState.RUNNING.toString)
     }
 
-    eventually(timeout(10.seconds)) {
-      assert(getBatchJobSubmissionStateCounter(OperationState.INITIALIZED) +
-        getBatchJobSubmissionStateCounter(OperationState.PENDING) +
-        getBatchJobSubmissionStateCounter(OperationState.RUNNING) === 1)
+    eventually(timeout(20.seconds)) {
+      assert(getBatchJobSubmissionStateCounter(OperationState.RUNNING) === 1)
     }
 
     val deleteResp = webTarget.path(s"api/v1/batches/$batchId")

Reply via email to