-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
test(spanner): fix flaky restore_database() sample test #4641
Conversation
@@ -67,6 +67,13 @@ def test_create_backup(capsys, database): | |||
assert BACKUP_ID in out | |||
|
|||
|
|||
@pytest.mark.skip( |
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.
Can we mark the test with flaky?
You'll need to add
flaky==3.7.0
to requirements-test.txt.
Then mark the test:
@pytest.mark.flaky(max_runs=2, min_passes=1)
But the current timeout seems like 1200 seconds (20 minutes). This is likely problematic with the current test timeout with btlr.
@kurtisvg Is here a way to extend the timeout for a particular test?
I also think the restore operation for a small database should finish quicker. I would rather get annoyed with flaky build cop bot issues until the server side operations are quicker and more consistent.
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.
@kurtisvg Is here a way to extend the timeout for a particular test?
Nope
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.
I've used a RetryErrors decorator from the Cloud Spanner test_utils library which will retry the test on DEADLINE_EXCEEDED
for a maximum of two attempts. Is this an acceptable alternative to flaky
?
@larkee Thanks! |
…gleCloudPlatform/python-docs-samples#4641) * test(spanner): fix flaky restore backup sample test * fix: update timeout to match other languages * test: import test_utils and set max retries to 2 Co-authored-by: larkee <larkee@users.noreply.github.com>
Fixes #4544