@@ -24,8 +24,6 @@ async def wait_to_receive(dispatcher, ct, timeout=5.0, interval=0.05):
2424
2525@pytest .mark .asyncio
2626async def test_run_lambda_function (apg_dispatcher , pg_message ):
27- assert apg_dispatcher .pool .finished_count == 0
28-
2927 clearing_task = asyncio .create_task (apg_dispatcher .pool .events .work_cleared .wait (), name = 'test_lambda_clear_wait' )
3028 await pg_message ('lambda: "This worked!"' )
3129 await asyncio .wait_for (clearing_task , timeout = 3 )
@@ -93,7 +91,7 @@ async def test_cancel_task(apg_dispatcher, pg_message, pg_control):
9391 await pg_message (msg )
9492
9593 clearing_task = asyncio .create_task (apg_dispatcher .pool .events .work_cleared .wait ())
96- await asyncio .sleep (0.04 )
94+ await asyncio .sleep (0.2 )
9795 canceled_jobs = await asyncio .wait_for (pg_control .acontrol_with_reply ('cancel' , data = {'uuid' : 'foobar' }, timeout = 1 ), timeout = 5 )
9896 worker_id , canceled_message = canceled_jobs [0 ][0 ]
9997 assert canceled_message ['uuid' ] == 'foobar'
@@ -128,8 +126,6 @@ async def test_message_with_delay(apg_dispatcher, pg_message, pg_control):
128126
129127@pytest .mark .asyncio
130128async def test_cancel_delayed_task (apg_dispatcher , pg_message , pg_control ):
131- assert apg_dispatcher .pool .finished_count == 0
132-
133129 # Send message to run task with a delay
134130 msg = json .dumps ({'task' : 'lambda: print("This task should be canceled before start")' , 'uuid' : 'delay_task_will_cancel' , 'delay' : 0.8 })
135131 await pg_message (msg )
@@ -149,8 +145,6 @@ async def test_cancel_delayed_task(apg_dispatcher, pg_message, pg_control):
149145
150146@pytest .mark .asyncio
151147async def test_cancel_with_no_reply (apg_dispatcher , pg_message , pg_control ):
152- assert apg_dispatcher .pool .finished_count == 0
153-
154148 # Send message to run task with a delay
155149 msg = json .dumps ({'task' : 'lambda: print("This task should be canceled before start")' , 'uuid' : 'delay_task_will_cancel' , 'delay' : 2.0 })
156150 await pg_message (msg )
@@ -167,8 +161,6 @@ async def test_cancel_with_no_reply(apg_dispatcher, pg_message, pg_control):
167161
168162@pytest .mark .asyncio
169163async def test_alive_check (apg_dispatcher , pg_control ):
170- assert apg_dispatcher .control_count == 0
171-
172164 alive = await asyncio .wait_for (pg_control .acontrol_with_reply ('alive' , timeout = 1 ), timeout = 5 )
173165 assert alive == [None ]
174166
@@ -177,8 +169,6 @@ async def test_alive_check(apg_dispatcher, pg_control):
177169
178170@pytest .mark .asyncio
179171async def test_task_discard (apg_dispatcher , pg_message ):
180- assert apg_dispatcher .pool .finished_count == 0
181-
182172 messages = [
183173 json .dumps (
184174 {'task' : 'lambda: __import__("time").sleep(9)' , 'on_duplicate' : 'discard' , 'uuid' : f'dscd-{ i } ' }
@@ -195,8 +185,6 @@ async def test_task_discard(apg_dispatcher, pg_message):
195185
196186@pytest .mark .asyncio
197187async def test_task_discard_in_task_definition (apg_dispatcher , test_settings ):
198- assert apg_dispatcher .pool .finished_count == 0
199-
200188 for i in range (10 ):
201189 test_methods .sleep_discard .apply_async (args = [2 ], settings = test_settings )
202190
@@ -208,8 +196,6 @@ async def test_task_discard_in_task_definition(apg_dispatcher, test_settings):
208196
209197@pytest .mark .asyncio
210198async def test_tasks_in_serial (apg_dispatcher , test_settings ):
211- assert apg_dispatcher .pool .finished_count == 0
212-
213199 for i in range (10 ):
214200 test_methods .sleep_serial .apply_async (args = [2 ], settings = test_settings )
215201
@@ -221,8 +207,6 @@ async def test_tasks_in_serial(apg_dispatcher, test_settings):
221207
222208@pytest .mark .asyncio
223209async def test_tasks_queue_one (apg_dispatcher , test_settings ):
224- assert apg_dispatcher .pool .finished_count == 0
225-
226210 for i in range (10 ):
227211 test_methods .sleep_queue_one .apply_async (args = [2 ], settings = test_settings )
228212
0 commit comments