File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,9 @@ func TestStandardErrors(t *testing.T) {
7373}
7474
7575func TestStandardCapabilityCallsAreAsync (t * testing.T ) {
76+ // This test expects basic action's PerformAction to be called twice asynchronously and the results concatenated.
77+ // To ensure the calls are actually async, the mock will block the first call until the second call is made.
78+ // The first call sets InputThing to true, the second to false.
7679 t .Parallel ()
7780 mockExecutionHelper := NewMockExecutionHelper (t )
7881 mockExecutionHelper .EXPECT ().GetWorkflowExecutionID ().Return ("id" )
@@ -98,12 +101,10 @@ func TestStandardCapabilityCallsAreAsync(t *testing.T) {
98101 require .NoError (t , err )
99102
100103 // Don't return until the second call has been executed
101- defer func () {
102- if ! input .InputThing {
103- mt .Lock ()
104- }
105- defer mt .Unlock ()
106- }()
104+ if input .InputThing {
105+ mt .Lock ()
106+ }
107+ defer mt .Unlock ()
107108 return & sdk.CapabilityResponse {
108109 Response : & sdk.CapabilityResponse_Payload {Payload : payload },
109110 }, nil
You can’t perform that action at this time.
0 commit comments