Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 44580b3

Browse filesBrowse files
author
Takashi Matsuo
authored
[kms] chore: remove gcp-devrel-py-tools (GoogleCloudPlatform#3479)
1 parent acf89eb commit 44580b3
Copy full SHA for 44580b3

File tree

Expand file treeCollapse file tree

2 files changed

+12
-11
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-11
lines changed

‎kms/api-client/requirements-test.txt

Copy file name to clipboard
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1+
backoff==1.10.0
12
pytest==5.3.2
2-
gcp-devrel-py-tools==0.0.15
3-
google-cloud-core

‎kms/api-client/snippets_test.py

Copy file name to clipboardExpand all lines: kms/api-client/snippets_test.py
+11-9Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
from google.cloud import kms_v1
2121
from google.cloud.kms_v1 import enums
2222
from google.iam.v1.policy_pb2 import Policy
23-
23+
import backoff
2424
import pytest
2525

2626
import snippets
2727

28-
from gcp_devrel.testing import eventually_consistent
29-
3028

3129
def create_key_helper(key_id, purpose, algorithm, t):
3230
try:
@@ -181,6 +179,8 @@ def test_key_policy(self):
181179
self.member,
182180
self.role)
183181

182+
@backoff.on_exception(
183+
backoff.expo, (Aborted, AssertionError), max_time=60)
184184
def check_policy():
185185
policy = snippets.get_crypto_key_policy(
186186
self.project_id,
@@ -192,8 +192,9 @@ def check_policy():
192192
if b.role == self.role and self.member in b.members:
193193
found = True
194194
assert found
195-
eventually_consistent.call(check_policy,
196-
exceptions=(Aborted, AssertionError))
195+
196+
check_policy()
197+
197198
# remove member
198199
snippets.remove_member_from_crypto_key_policy(
199200
self.project_id,
@@ -203,7 +204,9 @@ def check_policy():
203204
self.member,
204205
self.role)
205206

206-
def check_policy():
207+
@backoff.on_exception(
208+
backoff.expo, (Aborted, AssertionError), max_time=60)
209+
def check_policy_again():
207210
policy = snippets.get_crypto_key_policy(
208211
self.project_id,
209212
self.location,
@@ -214,9 +217,8 @@ def check_policy():
214217
if b.role == self.role and self.member in b.members:
215218
found = True
216219
assert not found
217-
eventually_consistent.call(
218-
check_policy,
219-
exceptions=(Aborted, AssertionError))
220+
221+
check_policy_again()
220222

221223
def test_symmetric_encrypt_decrypt(self):
222224
cipher_bytes = snippets.encrypt_symmetric(self.project_id,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.