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

test: add retry for bucket cmek enabled system test #245

Merged
merged 3 commits into from
Aug 17, 2020

Conversation

HemangChothani
Copy link
Contributor

Fixes #239

Tried to reproduce locally but no results so far, so adding a retry for the test to avoid flaky failures.

@HemangChothani HemangChothani requested a review from tseaver August 14, 2020 07:26
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Aug 14, 2020
Copy link
Contributor

@tseaver tseaver left a comment

Choose a reason for hiding this comment

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

Retrying the whole test to work around an eventual consistency problem is too heavy a hammer. Instead, we should add a loop below, e.g. at line 2027:

        blob.upload_from_string(payload)
        while blob.kms_key_name is None:
            time.sleep(1)
            blob.reload()
        # We don't know the current version of the key.
        self.assertTrue(blob.kms_key_name.startswith(kms_key_name))

Or better yet, use one of the test_utils.retry utilities to accomplish that goal.

@HemangChothani
Copy link
Contributor Author

@tseaver If this solution is good enough then can we also change in #190, they had fixed it with retrying the whole test for test_bucket_w_default_kms_key_name system test.

@tseaver tseaver merged commit cd95200 into googleapis:master Aug 17, 2020
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
cojenco pushed a commit to cojenco/python-storage that referenced this pull request Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'TestKMSIntegration.test_upload_new_blob_w_bucket_cmek_enabled' flakes w/ EC error
2 participants