Skip to content

Commit

Permalink
Adjust startedCount assertion in Test_WorkflowLocalActivityWithMockAn…
Browse files Browse the repository at this point in the history
…dListeners

Execution of the LocalActivities happens asynchronously from the workflow execution. If the local activity has already been canceled by the time it goes to start the activity then the started listener is never invoked, and the test observes only a single activity being started. This is valid as the Workflow is written so adjust the assertion against it.
  • Loading branch information
natemort committed Jul 2, 2024
1 parent f309725 commit db9e047
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/internal_workflow_testsuite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,9 @@ func (s *WorkflowTestSuiteUnitTest) Test_WorkflowLocalActivityWithMockAndListene

env.ExecuteWorkflow(workflowFn)
env.AssertExpectations(s.T())
s.Equal(2, startedCount)
// the canceled workflow may not have actually started by the time it was canceled
s.GreaterOrEqual(1, startedCount)
s.LessOrEqual(2, startedCount)
s.Equal(1, completedCount)
s.Equal(1, canceledCount)
s.True(env.IsWorkflowCompleted())
Expand Down

0 comments on commit db9e047

Please sign in to comment.