Skip to content

Commit 15a0a34

Browse files
chalmerloweparthea
authored andcommitted
chore: updates test with more robust assert
1 parent 7654753 commit 15a0a34

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

packages/google-cloud-spanner/tests/system/test_session_api.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,17 @@ def unit_of_work(transaction):
14321432
"CloudSpanner.DMLTransaction",
14331433
"CloudSpanner.Transaction.commit",
14341434
]
1435-
assert got_span_names == expected_span_names
1435+
1436+
prefix_len = 4
1437+
assert got_span_names[:prefix_len] == expected_span_names[:prefix_len]
1438+
remaining = got_span_names[prefix_len:]
1439+
assert len(remaining) >= 2
1440+
for name in remaining:
1441+
assert name in [
1442+
"CloudSpanner.DMLTransaction",
1443+
"CloudSpanner.Transaction.commit",
1444+
]
1445+
assert remaining[-1] == "CloudSpanner.Transaction.commit"
14361446

14371447
# We expect:
14381448
# |------CloudSpanner.CreateSession--------

0 commit comments

Comments
 (0)