@@ -24,8 +24,6 @@ async def wait_to_receive(dispatcher, ct, timeout=5.0, interval=0.05):
24
24
25
25
@pytest .mark .asyncio
26
26
async def test_run_lambda_function (apg_dispatcher , pg_message ):
27
- assert apg_dispatcher .pool .finished_count == 0
28
-
29
27
clearing_task = asyncio .create_task (apg_dispatcher .pool .events .work_cleared .wait (), name = 'test_lambda_clear_wait' )
30
28
await pg_message ('lambda: "This worked!"' )
31
29
await asyncio .wait_for (clearing_task , timeout = 3 )
@@ -93,7 +91,7 @@ async def test_cancel_task(apg_dispatcher, pg_message, pg_control):
93
91
await pg_message (msg )
94
92
95
93
clearing_task = asyncio .create_task (apg_dispatcher .pool .events .work_cleared .wait ())
96
- await asyncio .sleep (0.04 )
94
+ await asyncio .sleep (0.2 )
97
95
canceled_jobs = await asyncio .wait_for (pg_control .acontrol_with_reply ('cancel' , data = {'uuid' : 'foobar' }, timeout = 1 ), timeout = 5 )
98
96
worker_id , canceled_message = canceled_jobs [0 ][0 ]
99
97
assert canceled_message ['uuid' ] == 'foobar'
@@ -128,8 +126,6 @@ async def test_message_with_delay(apg_dispatcher, pg_message, pg_control):
128
126
129
127
@pytest .mark .asyncio
130
128
async def test_cancel_delayed_task (apg_dispatcher , pg_message , pg_control ):
131
- assert apg_dispatcher .pool .finished_count == 0
132
-
133
129
# Send message to run task with a delay
134
130
msg = json .dumps ({'task' : 'lambda: print("This task should be canceled before start")' , 'uuid' : 'delay_task_will_cancel' , 'delay' : 0.8 })
135
131
await pg_message (msg )
@@ -149,8 +145,6 @@ async def test_cancel_delayed_task(apg_dispatcher, pg_message, pg_control):
149
145
150
146
@pytest .mark .asyncio
151
147
async def test_cancel_with_no_reply (apg_dispatcher , pg_message , pg_control ):
152
- assert apg_dispatcher .pool .finished_count == 0
153
-
154
148
# Send message to run task with a delay
155
149
msg = json .dumps ({'task' : 'lambda: print("This task should be canceled before start")' , 'uuid' : 'delay_task_will_cancel' , 'delay' : 2.0 })
156
150
await pg_message (msg )
@@ -167,8 +161,6 @@ async def test_cancel_with_no_reply(apg_dispatcher, pg_message, pg_control):
167
161
168
162
@pytest .mark .asyncio
169
163
async def test_alive_check (apg_dispatcher , pg_control ):
170
- assert apg_dispatcher .control_count == 0
171
-
172
164
alive = await asyncio .wait_for (pg_control .acontrol_with_reply ('alive' , timeout = 1 ), timeout = 5 )
173
165
assert alive == [None ]
174
166
@@ -177,8 +169,6 @@ async def test_alive_check(apg_dispatcher, pg_control):
177
169
178
170
@pytest .mark .asyncio
179
171
async def test_task_discard (apg_dispatcher , pg_message ):
180
- assert apg_dispatcher .pool .finished_count == 0
181
-
182
172
messages = [
183
173
json .dumps (
184
174
{'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):
195
185
196
186
@pytest .mark .asyncio
197
187
async def test_task_discard_in_task_definition (apg_dispatcher , test_settings ):
198
- assert apg_dispatcher .pool .finished_count == 0
199
-
200
188
for i in range (10 ):
201
189
test_methods .sleep_discard .apply_async (args = [2 ], settings = test_settings )
202
190
@@ -208,8 +196,6 @@ async def test_task_discard_in_task_definition(apg_dispatcher, test_settings):
208
196
209
197
@pytest .mark .asyncio
210
198
async def test_tasks_in_serial (apg_dispatcher , test_settings ):
211
- assert apg_dispatcher .pool .finished_count == 0
212
-
213
199
for i in range (10 ):
214
200
test_methods .sleep_serial .apply_async (args = [2 ], settings = test_settings )
215
201
@@ -221,8 +207,6 @@ async def test_tasks_in_serial(apg_dispatcher, test_settings):
221
207
222
208
@pytest .mark .asyncio
223
209
async def test_tasks_queue_one (apg_dispatcher , test_settings ):
224
- assert apg_dispatcher .pool .finished_count == 0
225
-
226
210
for i in range (10 ):
227
211
test_methods .sleep_queue_one .apply_async (args = [2 ], settings = test_settings )
228
212
0 commit comments