Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LIVY-659][TEST] Fix travis failed on can kill spark-submit while it'…
…s running ## What changes were proposed in this pull request? Fix travis failed on "can kill spark-submit while it's running" The cause of failed is as follows: 1. The test does not mock the method getApplicationReport of mockYarnClient, so yarnClient.getApplicationReport will return null. 2. If the thread yarnAppMonitorThread run before the test executing app.kill(), yarnAppMonitorThread will throw NullPointerException when execute appReport.getDiagnostics. 3. Then the NullPointerException was caught by yarnAppMonitorThread, and yarnAppMonitorThread changeState(SparkApp.State.FAILED). 4. At last, the test execute app.kill(), but the app state is FAILED, so it won't execute process.foreach(_.destroy()), which cause verify(mockSparkSubmit, times(1)).destroy() failed. ## How was this patch tested? Existed UT and IT. Author: runzhiwang <[email protected]> Closes apache#226 from runzhiwang/LIVY-659.
- Loading branch information