python-docs-samples icon indicating copy to clipboard operation
python-docs-samples copied to clipboard

spanner.cloud-client.backup_sample_test: test_restore_database failed

Open flaky-bot[bot] opened this issue 6 years ago • 8 comments

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.

flaky-bot[bot] avatar Aug 24 '20 11:08 flaky-bot[bot]

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).

flaky-bot[bot] avatar Aug 24 '20 11:08 flaky-bot[bot]

@larkee I hope it's ok that I added it to our current sprint to take a look.

skuruppu avatar Sep 03 '20 06:09 skuruppu

The test is flaky due to the restore operation not always completing in the allotted 20 minutes. There are two options here:

  1. Increase the timeout.
  2. 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?

larkee avatar Sep 07 '20 08:09 larkee

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.

skuruppu avatar Sep 08 '20 03:09 skuruppu

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.

larkee avatar Sep 08 '20 04:09 larkee

Aha good catch :) I guess restores are slower now for whatever reason.

skuruppu avatar Sep 08 '20 04:09 skuruppu

@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...

tmatsuo avatar Sep 08 '20 16:09 tmatsuo

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).

skuruppu avatar Sep 10 '20 06:09 skuruppu