From 19ae399445ca42cd3bcdbff41620203199acc64b Mon Sep 17 00:00:00 2001 From: sychen Date: Thu, 30 Nov 2023 10:10:28 +0800 Subject: [PATCH] [KYUUBI #5785] Fix flaky test - JpsApplicationOperation with spark local mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # :mag: Description ## Issue References ๐Ÿ”— This pull request fixes #2642 ## Describe Your Solution ๐Ÿ”ง https://github.com/apache/kyuubi/pull/2669#discussion_r874831326 ```bash jps -ml ``` ``` 99427 org.apache.spark.launcher.Main org.apache.spark.deploy.SparkSubmit --class org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver --conf spark.abc=123 ``` ``` 99416 org.apache.spark.deploy.SparkSubmit --conf spark.abc=123 --class org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver spark-internal ``` ## 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: https://github.com/apache/kyuubi/actions/runs/6981210739/job/18997901268?pr=5773 ``` - JpsApplicationOperation with spark local mode *** FAILED *** The code passed to eventually never returned normally. Attempted 41 times over 10.235822332 seconds. Last failure message: "23463" did not equal null. (JpsApplicationOperationSuite.scala:92) ``` #### Behavior With This Pull Request :tada: GA #### Related Unit Tests JpsApplicationOperationSuite "JpsApplicationOperation with spark local mode" --- # Checklists ## ๐Ÿ“ Author Self Checklist - [x] My code follows the [style guidelines](https://kyuubi.readthedocs.io/en/master/contributing/code/style.html) of this project - [x] I have performed a self-review - [ ] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [x] This patch was not authored or co-authored using [Generative Tooling](https://www.apache.org/legal/generative-tooling.html) ## ๐Ÿ“ Committer Pre-Merge Checklist - [ ] Pull request title is okay. - [ ] No license issues. - [ ] Milestone correctly set? - [ ] Test coverage is ok - [ ] Assignees are selected. - [ ] Minimum number of approvals - [ ] No changes are requested **Be nice. Be informative.** Closes #5785 from cxzl25/test_jps_local. Closes #5785 bb456a63b [sychen] Fix flaky test - JpsApplicationOperation with spark local mode Authored-by: sychen Signed-off-by: Cheng Pan --- .../org/apache/kyuubi/engine/JpsApplicationOperationSuite.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/JpsApplicationOperationSuite.scala b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/JpsApplicationOperationSuite.scala index a0914afcf..bdb0fa787 100644 --- a/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/JpsApplicationOperationSuite.scala +++ b/kyuubi-server/src/test/scala/org/apache/kyuubi/engine/JpsApplicationOperationSuite.scala @@ -83,6 +83,8 @@ class JpsApplicationOperationSuite extends KyuubiFunSuite { val desc1 = jps.getApplicationInfoByTag(ApplicationManagerInfo(None), id) assert(desc1.id != null) assert(desc1.name != null) + assert(!desc1.name.contains("org.apache.spark.launcher.Main")) + assert(desc1.name.contains("org.apache.spark.deploy.SparkSubmit")) assert(desc1.state == ApplicationState.RUNNING) val response = jps.killApplicationByTag(ApplicationManagerInfo(None), id) assert(response._1, response._2)