Skip to content

[TEST] Fix cancellation assertions for missing local batch applications - #7879

Open
zhangxinyao88 wants to merge 1 commit into
apache:masterfrom
zhangxinyao88:kyuubi-test-cancel-missing-batch
Open

zhangxinyao88 wants to merge 1 commit into
apache:masterfrom
zhangxinyao88:kyuubi-test-cancel-missing-batch

Conversation

@zhangxinyao88

Copy link
Copy Markdown
Contributor

Why are the changes needed?

A local batch application can disappear before Kyuubi handles its cancellation request. JPS then returns APPLICATION_NOT_FOUND with killed=false, but BatchJobSubmission.close still transitions the nonterminal operation to CANCELED. The existing REST test incorrectly assumes a false kill result rules out that state.

This caused the open batch session assertion to fail in this CI job. Require CANCELED for that specific response as well as a successful kill, while retaining the existing assertion for other failure responses. Production behavior is unchanged.

How was this patch tested?

  • Both original REST suites passed: BatchesV1ResourceSuite 15/15 and BatchesV2ResourceSuite 15/15, on macOS arm64, JDK 17, Scala 2.12.19 and Spark 3.5.9.
  • A separate controlled REST probe used the existing hidden-from-JPS fixture technique with a long-running local batch. The same false / APPLICATION_NOT_FOUND / CANCELED response failed the old postcondition and passed the corrected one, without relying on the short application's exit timing.
  • Ran dev/reformat, reactor Spotless and Scalastyle checks, and the root Apache RAT check.
build/mvn -Pscala-2.12 -Pspark-provided -Pflink-provided -Phive-provided \
  -pl kyuubi-server -am test -Dtest=none \
  -DwildcardSuites=org.apache.kyuubi.server.api.v1.BatchesV1ResourceSuite,org.apache.kyuubi.server.api.v1.BatchesV2ResourceSuite

SPARK_HOME used Spark 3.5.9, with SparkPi and DriverSubmissionTest built locally from the official v3.5.9 example sources. The controlled probe is additional diagnostic evidence, separate from the original suites. The full repository suite and other platform/engine matrices have not been run locally.

Draft pending author review. Remote CI results will be recorded when available.

Was this patch assisted by generative AI tooling?

Assisted-by: Codex (GPT-6)

@zhangxinyao88
zhangxinyao88 marked this pull request as ready for review November 29, 2026 16:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant