@@ -1546,6 +1546,20 @@ await TestHelpers.Await(() => GetInvocationLogs().Length == logLoop,
1546
1546
}
1547
1547
}
1548
1548
1549
+ [ Fact ]
1550
+ public async Task NullOutputBinding_DoesNotThrow ( )
1551
+ {
1552
+ await CreateDefaultWorkerChannel ( ) ;
1553
+
1554
+ var invocationId = Guid . NewGuid ( ) ;
1555
+ var resultSource = new TaskCompletionSource < ScriptInvocationResult > ( ) ;
1556
+ ScriptInvocationContext scriptInvocationContext = GetTestScriptInvocationContext ( invocationId , resultSource , logger : _logger ) ;
1557
+ await _workerChannel . SendInvocationRequest ( scriptInvocationContext ) ;
1558
+ await _workerChannel . InvokeResponse ( BuildSuccessfulInvocationResponseWithNullOutputBinding ( invocationId . ToString ( ) ) ) ;
1559
+
1560
+ Assert . Equal ( TaskStatus . RanToCompletion , resultSource . Task . Status ) ;
1561
+ }
1562
+
1549
1563
private static IEnumerable < FunctionMetadata > GetTestFunctionsList ( string runtime , bool addWorkerProperties = false )
1550
1564
{
1551
1565
return GetTestFunctionsList ( runtime , numberOfFunctions : 2 , addWorkerProperties ) ;
@@ -1690,6 +1704,30 @@ private static InvocationResponse BuildSuccessfulInvocationResponse(string invoc
1690
1704
} ;
1691
1705
}
1692
1706
1707
+ private InvocationResponse BuildSuccessfulInvocationResponseWithNullOutputBinding ( string invocationId )
1708
+ {
1709
+ StatusResult statusResult = new StatusResult ( )
1710
+ {
1711
+ Status = StatusResult . Types . Status . Success
1712
+ } ;
1713
+
1714
+ ParameterBinding parameterBinding = new ParameterBinding ( )
1715
+ {
1716
+ Name = "output1" ,
1717
+ Data = null
1718
+ } ;
1719
+
1720
+ InvocationResponse invocationResponse = new InvocationResponse ( )
1721
+ {
1722
+ InvocationId = invocationId == null ? "TestInvocationId" : invocationId ,
1723
+ Result = statusResult
1724
+ } ;
1725
+
1726
+ invocationResponse . OutputData . Add ( parameterBinding ) ;
1727
+
1728
+ return invocationResponse ;
1729
+ }
1730
+
1693
1731
private static FunctionMetadata BuildFunctionMetadataForHttpTrigger ( string name , string language = null )
1694
1732
{
1695
1733
var functionMetadata = new FunctionMetadata ( ) { Name = name , Language = language } ;
0 commit comments