@@ -197,12 +197,15 @@ async def test_sync_invocation_request_log(self):
197
197
with patch ('azure_functions_worker.dispatcher.logger' ) as mock_logger :
198
198
async with self ._ctrl as host :
199
199
request_id : str = self ._ctrl ._worker ._request_id
200
- func_id , invoke_id = await self ._check_if_function_is_ok (host )
200
+ func_id , invoke_id , func_name = (
201
+ await self ._check_if_function_is_ok (host )
202
+ )
201
203
202
204
mock_logger .info .assert_any_call (
203
205
'Received FunctionInvocationRequest, '
204
206
f'request ID: { request_id } , '
205
207
f'function ID: { func_id } , '
208
+ f'function name: { func_name } , '
206
209
f'invocation ID: { invoke_id } , '
207
210
'function type: sync, '
208
211
f'sync threadpool max workers: { self ._default_workers } '
@@ -212,14 +215,15 @@ async def test_async_invocation_request_log(self):
212
215
with patch ('azure_functions_worker.dispatcher.logger' ) as mock_logger :
213
216
async with self ._ctrl as host :
214
217
request_id : str = self ._ctrl ._worker ._request_id
215
- func_id , invoke_id = (
218
+ func_id , invoke_id , func_name = (
216
219
await self ._check_if_async_function_is_ok (host )
217
220
)
218
221
219
222
mock_logger .info .assert_any_call (
220
223
'Received FunctionInvocationRequest, '
221
224
f'request ID: { request_id } , '
222
225
f'function ID: { func_id } , '
226
+ f'function name: { func_name } , '
223
227
f'invocation ID: { invoke_id } , '
224
228
'function type: async'
225
229
)
@@ -230,12 +234,15 @@ async def test_sync_invocation_request_log_threads(self):
230
234
with patch ('azure_functions_worker.dispatcher.logger' ) as mock_logger :
231
235
async with self ._ctrl as host :
232
236
request_id : str = self ._ctrl ._worker ._request_id
233
- func_id , invoke_id = await self ._check_if_function_is_ok (host )
237
+ func_id , invoke_id , func_name = (
238
+ await self ._check_if_function_is_ok (host )
239
+ )
234
240
235
241
mock_logger .info .assert_any_call (
236
242
'Received FunctionInvocationRequest, '
237
243
f'request ID: { request_id } , '
238
244
f'function ID: { func_id } , '
245
+ f'function name: { func_name } , '
239
246
f'invocation ID: { invoke_id } , '
240
247
'function type: sync, '
241
248
'sync threadpool max workers: 5'
@@ -247,14 +254,15 @@ async def test_async_invocation_request_log_threads(self):
247
254
with patch ('azure_functions_worker.dispatcher.logger' ) as mock_logger :
248
255
async with self ._ctrl as host :
249
256
request_id : str = self ._ctrl ._worker ._request_id
250
- func_id , invoke_id = (
257
+ func_id , invoke_id , func_name = (
251
258
await self ._check_if_async_function_is_ok (host )
252
259
)
253
260
254
261
mock_logger .info .assert_any_call (
255
262
'Received FunctionInvocationRequest, '
256
263
f'request ID: { request_id } , '
257
264
f'function ID: { func_id } , '
265
+ f'function name: { func_name } , '
258
266
f'invocation ID: { invoke_id } , '
259
267
'function type: async'
260
268
)
@@ -267,12 +275,15 @@ async def test_sync_invocation_request_log_in_placeholder_threads(self):
267
275
})
268
276
269
277
request_id : str = self ._ctrl ._worker ._request_id
270
- func_id , invoke_id = await self ._check_if_function_is_ok (host )
278
+ func_id , invoke_id , func_name = (
279
+ await self ._check_if_function_is_ok (host )
280
+ )
271
281
272
282
mock_logger .info .assert_any_call (
273
283
'Received FunctionInvocationRequest, '
274
284
f'request ID: { request_id } , '
275
285
f'function ID: { func_id } , '
286
+ f'function name: { func_name } , '
276
287
f'invocation ID: { invoke_id } , '
277
288
'function type: sync, '
278
289
'sync threadpool max workers: 5'
@@ -286,14 +297,15 @@ async def test_async_invocation_request_log_in_placeholder_threads(self):
286
297
})
287
298
288
299
request_id : str = self ._ctrl ._worker ._request_id
289
- func_id , invoke_id = (
300
+ func_id , invoke_id , func_name = (
290
301
await self ._check_if_async_function_is_ok (host )
291
302
)
292
303
293
304
mock_logger .info .assert_any_call (
294
305
'Received FunctionInvocationRequest, '
295
306
f'request ID: { request_id } , '
296
307
f'function ID: { func_id } , '
308
+ f'function name: { func_name } , '
297
309
f'invocation ID: { invoke_id } , '
298
310
'function type: async'
299
311
)
@@ -308,7 +320,8 @@ async def _assert_workers_threadpool(self, ctrl, host,
308
320
309
321
async def _check_if_function_is_ok (self , host ) -> Tuple [str , str ]:
310
322
# Ensure the function can be properly loaded
311
- func_id , load_r = await host .load_function ('show_context' )
323
+ function_name = "show_context"
324
+ func_id , load_r = await host .load_function (function_name )
312
325
self .assertEqual (load_r .response .function_id , func_id )
313
326
self .assertEqual (load_r .response .result .status ,
314
327
protos .StatusResult .Success )
@@ -329,10 +342,11 @@ async def _check_if_function_is_ok(self, host) -> Tuple[str, str]:
329
342
self .assertEqual (call_r .response .result .status ,
330
343
protos .StatusResult .Success )
331
344
332
- return func_id , invoke_id
345
+ return func_id , invoke_id , function_name
333
346
334
347
async def _check_if_async_function_is_ok (self , host ) -> Tuple [str , str ]:
335
348
# Ensure the function can be properly loaded
349
+ function_name = "show_context_async"
336
350
func_id , load_r = await host .load_function ('show_context_async' )
337
351
self .assertEqual (load_r .response .function_id , func_id )
338
352
self .assertEqual (load_r .response .result .status ,
@@ -354,7 +368,7 @@ async def _check_if_async_function_is_ok(self, host) -> Tuple[str, str]:
354
368
self .assertEqual (call_r .response .result .status ,
355
369
protos .StatusResult .Success )
356
370
357
- return func_id , invoke_id
371
+ return func_id , invoke_id , function_name
358
372
359
373
360
374
class TestThreadPoolSettingsPython38 (TestThreadPoolSettingsPython37 ):
0 commit comments