This is an automated email from the ASF dual-hosted git repository.
chengpan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new fbe80ace1 [KYUUBI #5104][TEST] BatchesResourceSuite - expose the
metrics with operation type and current state
fbe80ace1 is described below
commit fbe80ace11e4049e5a00737a208dfe6f50e3d370
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]>
---
.../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 f1ee71bec..fd4cca329 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
@@ -751,9 +751,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")
@@ -766,10 +772,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")