Skip to content

Commit a92b7f5

Browse files
committed
chore: updates test with more robust assert
1 parent c3240b5 commit a92b7f5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,17 @@ def unit_of_work(transaction):
14351435
"CloudSpanner.DMLTransaction",
14361436
"CloudSpanner.Transaction.commit",
14371437
]
1438-
assert got_span_names == expected_span_names
1438+
1439+
prefix_len = 4
1440+
assert got_span_names[:prefix_len] == expected_span_names[:prefix_len]
1441+
remaining = got_span_names[prefix_len:]
1442+
assert len(remaining) >= 2
1443+
for name in remaining:
1444+
assert name in [
1445+
"CloudSpanner.DMLTransaction",
1446+
"CloudSpanner.Transaction.commit",
1447+
]
1448+
assert remaining[-1] == "CloudSpanner.Transaction.commit"
14391449

14401450
# We expect:
14411451
# |------CloudSpanner.CreateSession--------

0 commit comments

Comments
 (0)