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

Explicitly throw TimeoutError when job times out #4514

Merged
merged 3 commits into from Sep 22, 2021

Conversation

dabacon
Copy link
Collaborator

@dabacon dabacon commented Sep 21, 2021

Fixes #4507

@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Sep 21, 2021
@CirqBot CirqBot added the size: S 10< lines changed <50 label Sep 21, 2021
Copy link
Collaborator

@vtomole vtomole left a comment

Choose a reason for hiding this comment

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

LGTM pending one off-topic nit.

@@ -199,6 +199,8 @@ def results(
if 'failure' in self._job and 'error' in self._job['failure']:
error = self._job['failure']['error']
raise RuntimeError(f'Job failed. Error message: {error}')
if time_waited_seconds >= timeout_seconds:
raise TimeoutError(f'Job timed out after waiting {time_waited_seconds} seconds.')
raise RuntimeError(
f'Job was not completed successful. Instead had status: {self.status()}'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
f'Job was not completed successful. Instead had status: {self.status()}'
f'Job was not completed successfully. Instead had status: {self.status()}'

@dabacon dabacon merged commit f1964e5 into quantumlib:master Sep 22, 2021
@dabacon dabacon deleted the timeout branch April 16, 2022 15:42
rht pushed a commit to rht/Cirq that referenced this pull request May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining. size: S 10< lines changed <50
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IonQ Job should throw TimeoutError when wait time exceeded
3 participants