Skip to content
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

Merged
merged 2 commits into from
Aug 16, 2018

Conversation

delapuente
Copy link
Contributor

@delapuente delapuente commented Aug 15, 2018

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.

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.
@@ -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
Copy link
Contributor Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, agree.

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)
Copy link
Member

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?

Copy link
Contributor Author

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.

@atilag atilag merged commit aed3368 into Qiskit:master Aug 16, 2018
@delapuente delapuente deleted the issue-780-master-is-failing branch November 8, 2018 15:09
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
…ling

Tests revealed a couple of bugs in the codebase.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants