@@ -93,8 +93,16 @@ public async Task TestWorkflows()
93
93
input : input ,
94
94
workflowOptions : workflowOptions ) ;
95
95
96
- // RAISE EVENT TEST
97
- await daprClient . RaiseWorkflowEventAsync ( instanceId2 , workflowComponent , "ChangePurchaseItem" , "computers" ) ;
96
+ // PARALLEL RAISE EVENT TEST
97
+ var event1 = daprClient . RaiseWorkflowEventAsync ( instanceId2 , workflowComponent , "ChangePurchaseItem" , "computers" ) ;
98
+ var event2 = daprClient . RaiseWorkflowEventAsync ( instanceId2 , workflowComponent , "ChangePurchaseItem" , "computers" ) ;
99
+ var event3 = daprClient . RaiseWorkflowEventAsync ( instanceId2 , workflowComponent , "ChangePurchaseItem" , "computers" ) ;
100
+ var event4 = daprClient . RaiseWorkflowEventAsync ( instanceId2 , workflowComponent , "ChangePurchaseItem" , "computers" ) ;
101
+ var event5 = daprClient . RaiseWorkflowEventAsync ( instanceId2 , workflowComponent , "ChangePurchaseItem" , "computers" ) ;
102
+
103
+ var externalEvents = Task . WhenAll ( event1 , event2 , event3 , event4 , event5 ) ;
104
+ var winner = await Task . WhenAny ( externalEvents , Task . Delay ( TimeSpan . FromSeconds ( 30 ) ) ) ;
105
+ externalEvents . IsCompletedSuccessfully . Should ( ) . BeTrue ( $ "Unsuccessful at raising events. Status of events: { externalEvents . IsCompletedSuccessfully } ") ;
98
106
99
107
// Wait up to 30 seconds for the workflow to complete and check the output
100
108
using var cts = new CancellationTokenSource ( delay : TimeSpan . FromSeconds ( 30 ) ) ;
0 commit comments