Skip to content

Commit 9255375

Browse files
authored
PYTHON-3284 Fix test_snapshot_query by waiting for documents to be committed to the snapshot (#1019)
1 parent 065b02b commit 9255375

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/test_examples.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,9 +1372,9 @@ def check_for_snapshot(self, collection):
13721372
"""
13731373
with self.client.start_session(snapshot=True) as s:
13741374
try:
1375-
with collection.aggregate([], session=s):
1376-
pass
1377-
return True
1375+
if collection.find_one(session=s):
1376+
return True
1377+
return False
13781378
except OperationFailure as e:
13791379
# Retry them as the server demands...
13801380
if e.code == 246: # SnapshotUnavailable

0 commit comments

Comments
 (0)