@@ -103,6 +103,7 @@ async def test_dispatcher_environment_reload_logging(self):
103
103
mode (Linux Consumption)
104
104
"""
105
105
async with self ._ctrl as host :
106
+ await host .init_worker ()
106
107
await self ._check_if_function_is_ok (host )
107
108
108
109
# Reload environment variable on specialization
@@ -155,6 +156,7 @@ async def test_dispatcher_sync_threadpool_invalid_worker_count(self):
155
156
os .environ .update ({PYTHON_THREADPOOL_THREAD_COUNT : 'invalid' })
156
157
157
158
async with self ._ctrl as host :
159
+ await host .init_worker ()
158
160
await self ._check_if_function_is_ok (host )
159
161
await self ._assert_workers_threadpool (self ._ctrl , host ,
160
162
self ._default_workers )
@@ -169,6 +171,7 @@ async def test_dispatcher_sync_threadpool_below_min_setting(self):
169
171
# Configure thread pool max worker to an invalid value
170
172
os .environ .update ({PYTHON_THREADPOOL_THREAD_COUNT : '0' })
171
173
async with self ._ctrl as host :
174
+ await host .init_worker ()
172
175
await self ._check_if_function_is_ok (host )
173
176
await self ._assert_workers_threadpool (self ._ctrl , host ,
174
177
self ._default_workers )
@@ -187,6 +190,7 @@ async def test_dispatcher_sync_threadpool_exceed_max_setting(self):
187
190
os .environ .update ({PYTHON_THREADPOOL_THREAD_COUNT :
188
191
f'{ self ._over_max_workers } ' })
189
192
async with self ._ctrl as host :
193
+ await host .init_worker ('4.15.1' )
190
194
await self ._check_if_function_is_ok (host )
191
195
192
196
# Ensure the dispatcher sync threadpool should fallback to max
@@ -198,6 +202,7 @@ async def test_dispatcher_sync_threadpool_in_placeholder(self):
198
202
mode (Linux Consumption)
199
203
"""
200
204
async with self ._ctrl as host :
205
+ await host .init_worker ()
201
206
await self ._check_if_function_is_ok (host )
202
207
203
208
# Reload environment variable on specialization
@@ -213,6 +218,7 @@ async def test_dispatcher_sync_threadpool_in_placeholder_invalid(self):
213
218
"""
214
219
with patch ('azure_functions_worker.dispatcher.logger' ) as mock_logger :
215
220
async with self ._ctrl as host :
221
+ await host .init_worker ()
216
222
await self ._check_if_function_is_ok (host )
217
223
218
224
# Reload environment variable on specialization
@@ -234,6 +240,7 @@ async def test_dispatcher_sync_threadpool_in_placeholder_above_max(self):
234
240
"""
235
241
with patch ('azure_functions_worker.dispatcher.logger' ):
236
242
async with self ._ctrl as host :
243
+ await host .init_worker ()
237
244
await self ._check_if_function_is_ok (host )
238
245
239
246
# Reload environment variable on specialization
@@ -249,6 +256,7 @@ async def test_dispatcher_sync_threadpool_in_placeholder_below_min(self):
249
256
"""
250
257
with patch ('azure_functions_worker.dispatcher.logger' ) as mock_logger :
251
258
async with self ._ctrl as host :
259
+ await host .init_worker ()
252
260
await self ._check_if_function_is_ok (host )
253
261
254
262
# Reload environment variable on specialization
@@ -268,6 +276,7 @@ async def test_dispatcher_sync_threadpool_in_placeholder_below_min(self):
268
276
async def test_sync_invocation_request_log (self ):
269
277
with patch ('azure_functions_worker.dispatcher.logger' ) as mock_logger :
270
278
async with self ._ctrl as host :
279
+ await host .init_worker ()
271
280
request_id : str = self ._ctrl ._worker ._request_id
272
281
func_id , invoke_id , func_name = (
273
282
await self ._check_if_function_is_ok (host )
@@ -286,6 +295,7 @@ async def test_sync_invocation_request_log(self):
286
295
async def test_async_invocation_request_log (self ):
287
296
with patch ('azure_functions_worker.dispatcher.logger' ) as mock_logger :
288
297
async with self ._ctrl as host :
298
+ await host .init_worker ()
289
299
request_id : str = self ._ctrl ._worker ._request_id
290
300
func_id , invoke_id , func_name = (
291
301
await self ._check_if_async_function_is_ok (host )
@@ -543,6 +553,7 @@ async def test_dispatcher_functions_metadata_request(self):
543
553
when a functions metadata request is received
544
554
"""
545
555
async with self ._ctrl as host :
556
+ await host .init_worker ()
546
557
r = await host .get_functions_metadata ()
547
558
self .assertIsInstance (r .response , protos .FunctionMetadataResponse )
548
559
self .assertFalse (r .response .use_default_metadata_indexing )
@@ -554,6 +565,7 @@ async def test_dispatcher_functions_metadata_request_with_retry(self):
554
565
when a functions metadata request is received
555
566
"""
556
567
async with self ._ctrl as host :
568
+ await host .init_worker ()
557
569
r = await host .get_functions_metadata ()
558
570
self .assertIsInstance (r .response , protos .FunctionMetadataResponse )
559
571
self .assertFalse (r .response .use_default_metadata_indexing )
@@ -609,7 +621,7 @@ async def test_dispatcher_load_azfunc_in_init(self):
609
621
"""Test if azure functions is loaded during init
610
622
"""
611
623
async with self ._ctrl as host :
612
- r = await host .init_worker ('4.15.1' )
624
+ r = await host .init_worker ()
613
625
self .assertEqual (
614
626
len ([log for log in r .logs if log .message .startswith (
615
627
'Received WorkerInitRequest'
@@ -625,7 +637,7 @@ async def test_dispatcher_load_modules_dedicated_app(self):
625
637
626
638
# Dedicated Apps where placeholder mode is not set
627
639
async with self ._ctrl as host :
628
- r = await host .init_worker ('4.15.1' )
640
+ r = await host .init_worker ()
629
641
logs = [log .message for log in r .logs ]
630
642
self .assertIn (
631
643
"Applying prioritize_customer_dependencies: "
@@ -643,7 +655,7 @@ async def test_dispatcher_load_modules_con_placeholder_enabled(self):
643
655
os .environ ["CONTAINER_NAME" ] = "test"
644
656
os .environ ["WEBSITE_PLACEHOLDER_MODE" ] = "1"
645
657
async with self ._ctrl as host :
646
- r = await host .init_worker ('4.15.1' )
658
+ r = await host .init_worker ()
647
659
logs = [log .message for log in r .logs ]
648
660
self .assertNotIn (
649
661
"Applying prioritize_customer_dependencies: "
@@ -660,7 +672,7 @@ async def test_dispatcher_load_modules_con_app_placeholder_disabled(self):
660
672
os .environ ["WEBSITE_PLACEHOLDER_MODE" ] = "0"
661
673
os .environ ["CONTAINER_NAME" ] = "test"
662
674
async with self ._ctrl as host :
663
- r = await host .init_worker ('4.15.1' )
675
+ r = await host .init_worker ()
664
676
logs = [log .message for log in r .logs ]
665
677
self .assertIn (
666
678
"Applying prioritize_customer_dependencies: "
0 commit comments