spanner.cloud-client.backup_sample_test: test_restore_database failed
Note: #3238 was also for this test, but it was closed more than 10 days ago. So, I didn't mark it flaky.
commit: 335886ab2da68426b00a56fa7abd33ce1c733b4b buildURL: Build Status, Sponge status: failed
Test output
Traceback (most recent call last):
File "/workspace/spanner/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/google/api_core/retry.py", line 184, in retry_target
return target()
File "/workspace/spanner/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/google/api_core/future/polling.py", line 84, in _done_or_raise
raise _OperationNotComplete()
google.api_core.future.polling._OperationNotComplete
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/workspace/spanner/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/google/api_core/future/polling.py", line 104, in blocking_poll
retry(self._done_or_raise)()
File "/workspace/spanner/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/google/api_core/retry.py", line 286, in retry_wrapped_func
on_error=on_error,
File "/workspace/spanner/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/google/api_core/retry.py", line 206, in retry_target
last_exc,
File "", line 3, in raise_from
google.api_core.exceptions.RetryError: Deadline of 1200.0s exceeded while calling functools.partial(<bound method PollingFuture._done_or_raise of <google.api_core.operation.Operation object at 0x7f8f08c19750>>), last exception:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/workspace/spanner/cloud-client/backup_sample_test.py", line 71, in test_restore_database
backup_sample.restore_database(INSTANCE_ID, RESTORE_DB_ID, BACKUP_ID)
File "/workspace/spanner/cloud-client/backup_sample.py", line 71, in restore_database
operation.result(1200)
File "/workspace/spanner/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/google/api_core/future/polling.py", line 125, in result
self._blocking_poll(timeout=timeout)
File "/workspace/spanner/cloud-client/.nox/py-3-7/lib/python3.7/site-packages/google/api_core/future/polling.py", line 107, in _blocking_poll
"Operation did not complete within the designated " "timeout."
concurrent.futures._base.TimeoutError: Operation did not complete within the designated timeout.
Looks like this issue is flaky. :worried:
I'm going to leave this open and stop commenting.
A human should fix and close this.
When run at the same commit (335886ab2da68426b00a56fa7abd33ce1c733b4b), this test passed in one build (Build Status, Sponge) and failed in another build (Build Status, Sponge).
@larkee I hope it's ok that I added it to our current sprint to take a look.
The test is flaky due to the restore operation not always completing in the allotted 20 minutes. There are two options here:
- Increase the timeout.
- Skip the test.
I believe Node.js has a longer timeout while C++ skips this test.
@tmatsuo Do you have a particular preference for this repo?
Incredibly, in Node.js for the samples, the test timeout is 600secs which seems really short to get the restore to complete by. We have build cop enabled and it periodically files issues for flaky tests, but it's never been for restore backup.
Unfortunately, I think Node.js actually is running into the same issue: googleapis/nodejs-spanner/issues/1231
Since increasing the timeout to reduce flakiness will significantly slow down the speed of the tests for everyone I've written a PR to skip it.
Aha good catch :) I guess restores are slower now for whatever reason.
@larkee
My preference is to find a timeout for 90% success rate and retry the test 2 or 3 times, then embrace the inevitably flakiness.
If we skip the test, we won't detect breakage...
Thanks @tmatsuo, I did the same for Node.js where I increased the timeout and also added some retries (https://github.com/googleapis/nodejs-spanner/pull/1234).