GitHub user AlexanderShoshin opened a pull request: https://github.com/apache/zeppelin/pull/2014
[ZEPPELIN-2065] Flaky test: NotebookTest.testSchedulePoolUsage ### What is this PR for? `testSchedulePoolUsage()` test checks that jobs can be executed several times in a row using a cron expression. It failed sometimes when it checked job completion by monitoring `job.dateFinished` and then tried to assert that `job.status` is `FINISHED`. It was not always true because `job.status` is changed after `job.dateFinished`. ### What type of PR is it? Bug Fix ### Todos * [ ] We need to catch job completion by checking `job.status` instead of `job.dateFinished`. * [ ] It is better to catch job completion by adding job status change listener instead of using `Thread.sleep(..)` in a test method. * [ ] We can make this test simpler by removing a check that a job will not run after a cron expressin is removed. We already have such check in a previous unit test named `testSchedule()`. ### What is the Jira issue? [ZEPPELIN-2065](https://issues.apache.org/jira/browse/ZEPPELIN-2065) ### Questions: * Does the licenses files need update? **no** * Is there breaking changes for older versions? **no** * Does this needs documentation? **no** You can merge this pull request into a Git repository by running: $ git pull https://github.com/AlexanderShoshin/zeppelin ZEPPELIN-2065 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/zeppelin/pull/2014.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #2014 ---- commit 8a0fe02846251ec4492847daf342c29823a3304f Author: Alexander Shoshin <alexander_shos...@epam.com> Date: 2017-02-10T15:09:03Z use job status listener to count jobs launched by cron expression ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---