@@ -10,25 +10,27 @@ def flood_with_requests(bounded_db, async_db):
1010 We can only try and make it as large as possible. However, if the system
1111 is fast enough, it may still be 0.
1212 """
13+ bounded_db .aql .execute ("RETURN SLEEP(0.5)" , count = True )
1314 for _ in range (3 ):
1415 for _ in range (500 ):
1516 async_db .aql .execute ("RETURN SLEEP(0.5)" , count = True )
16- for _ in range (3 ):
17- bounded_db .aql .execute ("RETURN SLEEP(0.5)" , count = True )
17+ bounded_db .aql .execute ("RETURN SLEEP(0.5)" , count = True )
1818 if bounded_db .last_queue_time >= 0 :
1919 break
2020
2121
2222def test_queue_bounded (db ):
2323 bounded_db = db .begin_queue_bounded_execution (100 )
24+ assert bounded_db .max_queue_time == 100
25+
2426 async_db = db .begin_async_execution (return_result = True )
2527
2628 flood_with_requests (bounded_db , async_db )
2729 assert bounded_db .last_queue_time >= 0
2830
2931 # We can only emit a warning here. The test will still pass.
3032 if bounded_db .last_queue_time == 0 :
31- warnings .warn ("last_queue_time is 0, test may be unreliable" )
33+ warnings .warn (f "last_queue_time of { bounded_db } is 0, test may be unreliable" )
3234
3335 bounded_db .adjust_max_queue_time (0.0001 )
3436 try :
@@ -39,5 +41,6 @@ def test_queue_bounded(db):
3941 assert e .error_code == 21004
4042 else :
4143 warnings .warn (
42- f"last queue time is { bounded_db .last_queue_time } , test may be unreliable"
44+ f"last_queue_time of { bounded_db } is { bounded_db .last_queue_time } ,"
45+ f"test may be unreliable"
4346 )
0 commit comments