File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1380,7 +1380,6 @@ async def test_getMore_does_not_send_readPreference(self):
1380
1380
self .assertEqual ("getMore" , started [1 ].command_name )
1381
1381
self .assertNotIn ("$readPreference" , started [1 ].command )
1382
1382
1383
- @async_client_context .require_version_min (4 , 0 )
1384
1383
@async_client_context .require_replica_set
1385
1384
async def test_to_list_tailable (self ):
1386
1385
oplog = self .client .local .oplog .rs
@@ -1391,7 +1390,10 @@ async def test_to_list_tailable(self):
1391
1390
{"ts" : {"$gte" : ts }}, cursor_type = pymongo .CursorType .TAILABLE_AWAIT , oplog_replay = True
1392
1391
).max_await_time_ms (1 )
1393
1392
self .addAsyncCleanup (c .close )
1394
- docs = await c .to_list ()
1393
+ # Wait for the change to be read.
1394
+ docs = []
1395
+ while not docs :
1396
+ docs = await c .to_list ()
1395
1397
self .assertGreaterEqual (len (docs ), 1 )
1396
1398
1397
1399
async def test_to_list_empty (self ):
Original file line number Diff line number Diff line change @@ -1371,7 +1371,6 @@ def test_getMore_does_not_send_readPreference(self):
1371
1371
self .assertEqual ("getMore" , started [1 ].command_name )
1372
1372
self .assertNotIn ("$readPreference" , started [1 ].command )
1373
1373
1374
- @client_context .require_version_min (4 , 0 )
1375
1374
@client_context .require_replica_set
1376
1375
def test_to_list_tailable (self ):
1377
1376
oplog = self .client .local .oplog .rs
@@ -1382,7 +1381,10 @@ def test_to_list_tailable(self):
1382
1381
{"ts" : {"$gte" : ts }}, cursor_type = pymongo .CursorType .TAILABLE_AWAIT , oplog_replay = True
1383
1382
).max_await_time_ms (1 )
1384
1383
self .addCleanup (c .close )
1385
- docs = c .to_list ()
1384
+ # Wait for the change to be read.
1385
+ docs = []
1386
+ while not docs :
1387
+ docs = c .to_list ()
1386
1388
self .assertGreaterEqual (len (docs ), 1 )
1387
1389
1388
1390
def test_to_list_empty (self ):
You can’t perform that action at this time.
0 commit comments