-
Notifications
You must be signed in to change notification settings - Fork 61
Description
Is your feature request related to a problem? Please describe.
Pod.wait_for_status raises a TimeoutExpiredException when the stop_status is reached. This is not differentiated from reaching the end of the timeout.
Describe the solution you'd like
There are two ways to solve this IMO, one is to define a new exception which is raised when this state is reached eg. StopStatusReachedException
OR
Allow the user to specify what exception is thrown when the stop status is reached
pod.wait_for_status(Pod.Status.SUCCEEDED, timeout=10, stop_status=Pod.Status.FAILED(I know this is default), sleep=1, stop_status_exc=PodFailedException)
Describe alternatives you've considered
My current solution is to try except the wait_for_status to handle the TimeoutExpiredException during pod failure but it cannot be differentiated from when the timeout is actually reached.
Additional context
Add any other context or screenshots about the feature request here.
One of my implementations of this https://github.com/opendatahub-io/opendatahub-tests/pull/532/files#diff-a85e4ce9f4e7c1f5f284567ab65433b8ed9cc19bf07740e7fb037895f4359a8bR104-R107