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

Deflake bigtable and spanner tests. #2224

Merged
merged 1 commit into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 19 additions & 9 deletions bigtable/metricscaler/metricscaler_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,27 @@ def test_scale_bigtable():

scale_bigtable(BIGTABLE_INSTANCE, BIGTABLE_INSTANCE, True)

time.sleep(10)
cluster.reload()

new_node_count = cluster.serve_nodes
assert (new_node_count == (original_node_count + SIZE_CHANGE_STEP))
for n in range(10):
time.sleep(10)
cluster.reload()
new_node_count = cluster.serve_nodes
try:
assert (new_node_count == (original_node_count + SIZE_CHANGE_STEP))
except AssertionError:
if n == 9:
raise

scale_bigtable(BIGTABLE_INSTANCE, BIGTABLE_INSTANCE, False)
time.sleep(10)
cluster.reload()
final_node_count = cluster.serve_nodes
assert final_node_count == original_node_count

for n in range(10):
time.sleep(10)
cluster.reload()
final_node_count = cluster.serve_nodes
try:
assert final_node_count == original_node_count
except AssertionError:
if n == 9:
raise


# Unit test for logic
Expand Down
4 changes: 3 additions & 1 deletion spanner/cloud-client/snippets_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ def test_query_with_struct(capsys):
def test_query_with_array_of_struct(capsys):
snippets.query_with_array_of_struct(INSTANCE_ID, DATABASE_ID)
out, _ = capsys.readouterr()
assert 'SingerId: 8\nSingerId: 7\nSingerId: 6' in out
assert 'SingerId: 8' in out
assert 'SingerId: 7' in out
assert 'SingerId: 6' in out


def test_query_struct_field(capsys):
Expand Down