@@ -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'
@@ -125,8 +123,6 @@ async def test_message_with_delay(apg_dispatcher, pg_message, pg_control):
125123
126124@pytest .mark .asyncio
127125async def test_cancel_delayed_task (apg_dispatcher , pg_message , pg_control ):
128- assert apg_dispatcher .pool .finished_count == 0
129-
130126 # Send message to run task with a delay
131127 msg = json .dumps ({'task' : 'lambda: print("This task should be canceled before start")' , 'uuid' : 'delay_task_will_cancel' , 'delay' : 0.8 })
132128 await pg_message (msg )
@@ -146,8 +142,6 @@ async def test_cancel_delayed_task(apg_dispatcher, pg_message, pg_control):
146142
147143@pytest .mark .asyncio
148144async def test_cancel_with_no_reply (apg_dispatcher , pg_message , pg_control ):
149- assert apg_dispatcher .pool .finished_count == 0
150-
151145 # Send message to run task with a delay
152146 msg = json .dumps ({'task' : 'lambda: print("This task should be canceled before start")' , 'uuid' : 'delay_task_will_cancel' , 'delay' : 2.0 })
153147 await pg_message (msg )
@@ -164,8 +158,6 @@ async def test_cancel_with_no_reply(apg_dispatcher, pg_message, pg_control):
164158
165159@pytest .mark .asyncio
166160async def test_alive_check (apg_dispatcher , pg_control ):
167- assert apg_dispatcher .control_count == 0
168-
169161 alive = await asyncio .wait_for (pg_control .acontrol_with_reply ('alive' , timeout = 1 ), timeout = 5 )
170162 assert alive == [None ]
171163
@@ -174,8 +166,6 @@ async def test_alive_check(apg_dispatcher, pg_control):
174166
175167@pytest .mark .asyncio
176168async def test_task_discard (apg_dispatcher , pg_message ):
177- assert apg_dispatcher .pool .finished_count == 0
178-
179169 messages = [
180170 json .dumps (
181171 {'task' : 'lambda: __import__("time").sleep(9)' , 'on_duplicate' : 'discard' , 'uuid' : f'dscd-{ i } ' }
@@ -192,8 +182,6 @@ async def test_task_discard(apg_dispatcher, pg_message):
192182
193183@pytest .mark .asyncio
194184async def test_task_discard_in_task_definition (apg_dispatcher , test_settings ):
195- assert apg_dispatcher .pool .finished_count == 0
196-
197185 for i in range (10 ):
198186 test_methods .sleep_discard .apply_async (args = [2 ], settings = test_settings )
199187
@@ -205,8 +193,6 @@ async def test_task_discard_in_task_definition(apg_dispatcher, test_settings):
205193
206194@pytest .mark .asyncio
207195async def test_tasks_in_serial (apg_dispatcher , test_settings ):
208- assert apg_dispatcher .pool .finished_count == 0
209-
210196 for i in range (10 ):
211197 test_methods .sleep_serial .apply_async (args = [2 ], settings = test_settings )
212198
@@ -218,8 +204,6 @@ async def test_tasks_in_serial(apg_dispatcher, test_settings):
218204
219205@pytest .mark .asyncio
220206async def test_tasks_queue_one (apg_dispatcher , test_settings ):
221- assert apg_dispatcher .pool .finished_count == 0
222-
223207 for i in range (10 ):
224208 test_methods .sleep_queue_one .apply_async (args = [2 ], settings = test_settings )
225209
0 commit comments