Skip to content

Commit d0b1663

Browse files
authored
tests: harden 'snippets_table.py' teardown against 429 (#106)
Toward #87.
1 parent bb01279 commit d0b1663

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/google-cloud-bigtable/docs/snippets_table.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
import pytest
3434

3535
from test_utils.system import unique_resource_id
36+
from test_utils.retry import RetryErrors
37+
from google.api_core.exceptions import TooManyRequests
3638
from google.cloud._helpers import UTC
3739
from google.cloud.bigtable import Client
3840
from google.cloud.bigtable import enums
@@ -64,6 +66,8 @@
6466
CELL_VAL2 = b"cell-val2"
6567
ROW_KEY2 = b"row_key_id2"
6668

69+
retry_429 = RetryErrors(TooManyRequests, max_tries=9)
70+
6771

6872
class Config(object):
6973
"""Run-time configuration to be modified at set-up.
@@ -102,7 +106,7 @@ def setup_module():
102106

103107

104108
def teardown_module():
105-
Config.INSTANCE.delete()
109+
retry_429(Config.INSTANCE.delete)()
106110

107111

108112
def test_bigtable_create_table():

0 commit comments

Comments
 (0)