job.result() doesn't raise RuntimeJobFailureError for failed job #311
Labels
api action
Needs new API or changes to existing APIs before this ticket can be worked upon.
bug
Something isn't working
Describe the bug
job.result()
doesn't raiseRuntimeJobFailureError
even though the job failed.My program sends a bad job, calls
job.result()
thenjob.status()
. Here's theqiskit-ibm-runtime
tracing:job.result()
callswait_for_final_state
, which waits for websocket to close then callsstatus()
to get the latest status. It appears in this case, the call to get the latest status returned Running. Butwait_for_final_state
assumes it'd be one of the end state status (since websocket was closed). But because it's Running instead of Failed, it never raisesRuntimeJobFailureError
.The
job.status()
call that happens after shows the job had indeed failed.Steps to reproduce
I was only able to reproduce this in CI. Also only tested staging.
Expected behavior
RuntimeJobFailureError
should be raised.Suggested solutions
It looks like the server should have returned Failed instead of Running. So either the server needs to be fixed, or the client needs to double check the status is indeed a final one in
wait_for_final_state
.Additional Information
The text was updated successfully, but these errors were encountered: