[ZEPPELIN-6238] Prevent infinite loop in NotebookRestApiTest due to interpreter startup failure #5013
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What is this PR for?
The testRunNoteNonBlocking integration test in NotebookRestApiTest can enter an infinite loop when the Python interpreter fails to start. This happens because the interpreter cannot find the python executable, resulting in an IOException: error=2, No such file or directory.
The test uses httpPost with blocking=true, followed by p1.waitUntilFinished() to wait for the paragraph to complete. When the interpreter fails to start, the paragraph's status remains in a READY state instead of transitioning to ERROR. This causes waitUntilFinished() to wait indefinitely, as isTerminated() never returns true.
The fix is to modify the test logic to immediately check the paragraph's status after p1.waitUntilFinished(). By moving the assertEquals(Job.Status.FINISHED, p1.getStatus()) assertion to immediately after the wait call, the test will fail instantly if the paragraph's status is not FINISHED (e.g., ERROR). This prevents the test from proceeding to p2.waitUntilFinished() and avoids the infinite loop.
What type of PR is it?
Bug Fix
Todos
What is the Jira issue?
*[ZEPPELIN-6238]
How should this be tested?
Screenshots (if appropriate)
Questions: