@@ -2336,7 +2336,7 @@ def test_watch_document(client, cleanup, database):
23362336 doc_ref .set ({"first" : "Jane" , "last" : "Doe" , "born" : 1900 })
23372337 cleanup (doc_ref .delete )
23382338
2339- sleep (1 )
2339+ sleep (0.2 )
23402340
23412341 # Setup listener
23422342 def on_snapshot (docs , changes , read_time ):
@@ -2349,12 +2349,12 @@ def on_snapshot(docs, changes, read_time):
23492349 # Alter document
23502350 doc_ref .set ({"first" : "Ada" , "last" : "Lovelace" , "born" : 1815 })
23512351
2352- sleep (1 )
2352+ sleep (0.2 )
23532353
2354- for _ in range (10 ):
2354+ for _ in range (50 ):
23552355 if on_snapshot .called_count > 0 :
23562356 break
2357- sleep (1 )
2357+ sleep (0.2 )
23582358
23592359 if on_snapshot .called_count not in (1 , 2 ):
23602360 raise AssertionError (
@@ -2385,14 +2385,14 @@ def on_snapshot(docs, changes, read_time):
23852385 collection_ref .on_snapshot (on_snapshot )
23862386
23872387 # delay here so initial on_snapshot occurs and isn't combined with set
2388- sleep (1 )
2388+ sleep (0.2 )
23892389
23902390 doc_ref .set ({"first" : "Ada" , "last" : "Lovelace" , "born" : 1815 })
23912391
2392- for _ in range (10 ):
2392+ for _ in range (50 ):
23932393 if on_snapshot .born == 1815 :
23942394 break
2395- sleep (1 )
2395+ sleep (0.2 )
23962396
23972397 if on_snapshot .born != 1815 :
23982398 raise AssertionError (
@@ -2411,7 +2411,7 @@ def test_watch_query(client, cleanup, database):
24112411 doc_ref .set ({"first" : "Jane" , "last" : "Doe" , "born" : 1900 })
24122412 cleanup (doc_ref .delete )
24132413
2414- sleep (1 )
2414+ sleep (0.2 )
24152415
24162416 # Setup listener
24172417 def on_snapshot (docs , changes , read_time ):
@@ -2429,10 +2429,10 @@ def on_snapshot(docs, changes, read_time):
24292429 # Alter document
24302430 doc_ref .set ({"first" : "Ada" , "last" : "Lovelace" , "born" : 1815 })
24312431
2432- for _ in range (10 ):
2432+ for _ in range (50 ):
24332433 if on_snapshot .called_count == 1 :
24342434 return
2435- sleep (1 )
2435+ sleep (0.2 )
24362436
24372437 if on_snapshot .called_count != 1 :
24382438 raise AssertionError (
@@ -2806,7 +2806,7 @@ def on_snapshot(docs, changes, read_time):
28062806 on_snapshot .failed = None
28072807 query_ref .on_snapshot (on_snapshot )
28082808
2809- sleep (1 )
2809+ sleep (0.2 )
28102810
28112811 doc_ref1 .set ({"first" : "Ada" , "last" : "Lovelace" , "born" : 1815 })
28122812 cleanup (doc_ref1 .delete )
@@ -2823,10 +2823,10 @@ def on_snapshot(docs, changes, read_time):
28232823 doc_ref5 .set ({"first" : "Ada" , "last" : "lovelace" , "born" : 1815 })
28242824 cleanup (doc_ref5 .delete )
28252825
2826- for _ in range (10 ):
2826+ for _ in range (50 ):
28272827 if on_snapshot .last_doc_count == 5 :
28282828 break
2829- sleep (1 )
2829+ sleep (0.2 )
28302830
28312831 if on_snapshot .failed :
28322832 raise on_snapshot .failed
0 commit comments