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

Bigtable: 'test_bigtable_create_table' snippet flakes with '504 Deadline Exceeded'. #8889

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion bigtable/docs/snippets.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,18 @@ def test_bigtable_create_table():
table = instance.table("table_my")
# Define the GC policy to retain only the most recent 2 versions.
max_versions_rule = column_family.MaxVersionsGCRule(2)
table.create(column_families={"cf1": max_versions_rule})

RETRIES = 4
# Retry if deadline exceed error.
for retry in range(RETRIES):
try:
table.create(column_families={"cf1": max_versions_rule})
break
except Exception as e:
if retry == RETRIES - 1:
raise e
else:
time.sleep(2 ** (retry - 1))
sangramql marked this conversation as resolved.
Show resolved Hide resolved
# [END bigtable_create_table]

try:
Expand Down