From b9cb556550fdee7872ae1a27299c048cd7803d5f Mon Sep 17 00:00:00 2001 From: David Reiss Date: Mon, 30 Oct 2023 16:18:54 -0700 Subject: [PATCH] Fix schedule workflow unit test --- service/worker/scheduler/workflow_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/service/worker/scheduler/workflow_test.go b/service/worker/scheduler/workflow_test.go index 145c105930c8..0cc6f6c72772 100644 --- a/service/worker/scheduler/workflow_test.go +++ b/service/worker/scheduler/workflow_test.go @@ -1718,6 +1718,9 @@ func (s *workflowSuite) TestCANByIterations() { s.Fail("too many starts") return nil, nil }).Times(0).Maybe() + s.expectWatch(func(req *schedspb.WatchWorkflowRequest) (*schedspb.WatchWorkflowResponse, error) { + return &schedspb.WatchWorkflowResponse{Status: enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED}, nil + }).Times(0).Maybe() // this is ignored because we set iters explicitly s.env.RegisterDelayedCallback(func() { @@ -1755,6 +1758,9 @@ func (s *workflowSuite) TestCANBySuggested() { s.Fail("too many starts", req.Request.WorkflowId) return nil, nil }).Times(0).Maybe() + s.expectWatch(func(req *schedspb.WatchWorkflowRequest) (*schedspb.WatchWorkflowResponse, error) { + return &schedspb.WatchWorkflowResponse{Status: enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED}, nil + }).Times(0).Maybe() s.env.RegisterDelayedCallback(func() { s.env.SetContinueAsNewSuggested(true) @@ -1791,6 +1797,9 @@ func (s *workflowSuite) TestCANBySignal() { s.Fail("too many starts", req.Request.WorkflowId) return nil, nil }).Times(0).Maybe() + s.expectWatch(func(req *schedspb.WatchWorkflowRequest) (*schedspb.WatchWorkflowResponse, error) { + return &schedspb.WatchWorkflowResponse{Status: enumspb.WORKFLOW_EXECUTION_STATUS_COMPLETED}, nil + }).Times(0).Maybe() s.env.RegisterDelayedCallback(func() { s.env.SignalWorkflow(SignalNameForceCAN, nil)