-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests revealed a couple of bugs in the codebase. #781
Conversation
One related to the simplification of the Job API. It is now raising JobTimeoutError instead of TimeoutError and we forgot to update a reference. It also evindentiates an inconsistency in the way we treat exceptions. The other was related to a new update in the IBMQuantumExperience library. Now some server errors raise an ApiError that was not captured before.
qiskit/backends/ibmq/ibmqjob.py
Outdated
@@ -184,7 +184,7 @@ def result(self, timeout=None, wait=5): | |||
self._wait_for_submission() | |||
try: | |||
this_result = self._wait_for_job(timeout=timeout, wait=wait) | |||
except TimeoutError as err: | |||
except JobTimeoutError as err: | |||
# A timeout error retrieving the results does not imply the job | |||
# is failing. The job can be still running. This is why we are not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are explaining that "we throw if an error prevents Qiskit from knowing the exact state of a Job". Here, we do the contrary. I vote for changing this behaviour to make it consistent and change the tests accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, agree.
test/python/test_ibmqjob_states.py
Outdated
result = job.result(timeout=0.2) | ||
# TODO: This is inconsistent, the timeout prevents Qiskit from knowing | ||
# the exact state of the job so it should raise. | ||
self.assertRaises(QISKitError, result.get_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be throwing JobTimeoutError
here, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should, that way, we make it consistent again. But it's not because the error is not in the Job
but in the Result
object.
…ling Tests revealed a couple of bugs in the codebase.
Fix #780
One related to the simplification of the Job API. It is now raising JobTimeoutError instead of TimeoutError and we forgot to update a reference. It also evidentiates an inconsistency in the way we treat exceptions.
The other was related to a new update in the IBMQuantumExperience library. Now some server errors raise an ApiError that was not captured before.