@@ -555,6 +555,63 @@ public async Task SendLoadRequests_PublishesOutboundEvents()
555555 Assert . Equal ( 3 , functionLoadLogs . Count ( ) ) ; // one WorkInitRequest, two FunctionLoadRequest
556556 }
557557
558+ [ Fact ]
559+ public async Task SendLoadRequests_SkipParameterBindingData ( )
560+ {
561+ await CreateDefaultWorkerChannel ( ) ;
562+ _metricsLogger . ClearCollections ( ) ;
563+
564+ var binding = new BindingMetadata ( )
565+ {
566+ Name = "abc" ,
567+ Type = "BlobTrigger"
568+ } ;
569+
570+ binding . Properties . Add ( ScriptConstants . SkipDeferredBindingKey , true ) ;
571+ binding . Properties . Add ( ScriptConstants . SupportsDeferredBindingKey , true ) ;
572+
573+ IEnumerable < FunctionMetadata > functionMetadata = GetTestFunctionsList ( "node" ) ;
574+ foreach ( var function in functionMetadata )
575+ {
576+ function . Bindings . Add ( binding ) ;
577+ }
578+
579+ _workerChannel . SetupFunctionInvocationBuffers ( functionMetadata ) ;
580+ _workerChannel . SendFunctionLoadRequests ( null , TimeSpan . FromMinutes ( 5 ) ) ;
581+ await Task . Delay ( 500 ) ;
582+ AreExpectedMetricsGenerated ( ) ;
583+ Assert . Equal ( 0 , _metricsLogger . LoggedEvents . Count ( e => e . Contains ( MetricEventNames . FunctionBindingDeferred ) ) ) ;
584+ }
585+
586+ [ Fact ]
587+ public async Task SendLoadRequests_SupportParameterBindingData ( )
588+ {
589+ await CreateDefaultWorkerChannel ( ) ;
590+ _metricsLogger . ClearCollections ( ) ;
591+
592+ var binding = new BindingMetadata ( )
593+ {
594+ Name = "abc" ,
595+ Type = "BlobTrigger"
596+ } ;
597+
598+ binding . Properties . Add ( ScriptConstants . SupportsDeferredBindingKey , true ) ;
599+
600+ IEnumerable < FunctionMetadata > functionMetadata = GetTestFunctionsList ( "node" ) ;
601+ foreach ( var function in functionMetadata )
602+ {
603+ function . Bindings . Add ( binding ) ;
604+ }
605+
606+ _workerChannel . SetupFunctionInvocationBuffers ( functionMetadata ) ;
607+ _workerChannel . SendFunctionLoadRequests ( null , TimeSpan . FromMinutes ( 5 ) ) ;
608+ await Task . Delay ( 500 ) ;
609+ AreExpectedMetricsGenerated ( ) ;
610+ Assert . Equal ( 2 , _metricsLogger . LoggedEvents . Count ( e => e . Contains ( MetricEventNames . FunctionBindingDeferred ) ) ) ;
611+ Assert . Equal ( 1 , _metricsLogger . LoggedEvents . Count ( e => e . Contains ( $ "{ MetricEventNames . FunctionBindingDeferred } _js1") ) ) ;
612+ Assert . Equal ( 1 , _metricsLogger . LoggedEvents . Count ( e => e . Contains ( $ "{ MetricEventNames . FunctionBindingDeferred } _js2") ) ) ;
613+ }
614+
558615 [ Fact ]
559616 public async Task SendLoadRequestCollection_PublishesOutboundEvents ( )
560617 {
0 commit comments