Skip to content

Commit

Permalink
[KYUUBI #5104][TEST] BatchesResourceSuite - expose the metrics with o…
Browse files Browse the repository at this point in the history
…peration type and current state

# 🔍 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 🔖
- [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 ⚰️
GA sometimes fails

#### Behavior With This Pull Request 🎉
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

511a0f3 [sychen] trigger test
3862080 [sychen] trigger test
1f21003 [sychen] trigger test
292ea91 [sychen] DriverSubmissionTest
bc53d3d [sychen] test

Authored-by: sychen <[email protected]>
Signed-off-by: Cheng Pan <[email protected]>
  • Loading branch information
cxzl25 authored and pan3793 committed Feb 21, 2024
1 parent d516a5d commit fbe80ac
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand Down

0 comments on commit fbe80ac

Please sign in to comment.