Skip to content

Conversation

ansidev
Copy link
Contributor

@ansidev ansidev commented Aug 31, 2025

What changed?

  • Regenerate client_mock in service/worker/parentclosepolicy using mockgen
  • Fix failed test cases.

Why?

  • Partially fixes the issue #6759

How did you test it?
local tests

Potential risks
N/A

Release notes
N/A

Documentation Changes
N/A

@davidporter-id-au davidporter-id-au enabled auto-merge (squash) September 1, 2025 07:31
auto-merge was automatically disabled September 1, 2025 07:45

Head branch was pushed to by a user without write access

@ansidev ansidev force-pushed the cadence-6759-service-worker-parentclosepolicy branch from ef7d6bc to 105424b Compare September 1, 2025 07:45
@@ -319,7 +318,7 @@ func (s *transferActiveTaskExecutorSuite) TestProcessActivityTask_Ratelimits() {
s.NoError(err)
s.mockExecutionMgr.On("GetWorkflowExecution", mock.Anything, mock.Anything).Return(&persistence.GetWorkflowExecutionResponse{State: persistenceMutableState}, nil)

// expected calls to matching if task processing is allowed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calls are to matching (the service) - so the comment was correct

Copy link
Contributor Author

@ansidev ansidev Sep 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakobht I updated two comments a little bit. Please take a look!

@@ -491,7 +490,7 @@ func (s *transferActiveTaskExecutorSuite) TestProcessDecisionTask_Ratelimits() {
s.NoError(err)
s.mockExecutionMgr.On("GetWorkflowExecution", mock.Anything, mock.Anything).Return(&persistence.GetWorkflowExecutionResponse{State: persistenceMutableState}, nil)

// expected calls to matching if task processing is allowed
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The calls are to matching (the service) - so the comment was correct

Comment on lines +878 to +879
errs := []error{nil, &types.CancellationAlreadyRequestedError{}, &types.EntityNotExistsError{}}
return errs[rand.Intn(len(errs))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bad change - lets not do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakobht This change only rename the local variable errors because it collides with the imported package errors.

Comment on lines +895 to +896
errs := []error{nil, &types.EntityNotExistsError{}}
return errs[rand.Intn(len(errs))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a bad change - lets not do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakobht This change only rename the local variable errors because it collides with the imported package errors.

@ansidev ansidev force-pushed the cadence-6759-service-worker-parentclosepolicy branch 2 times, most recently from e8c91b8 to 740c88d Compare September 3, 2025 00:32
@ansidev ansidev force-pushed the cadence-6759-service-worker-parentclosepolicy branch from 740c88d to 8c86a5d Compare September 3, 2025 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants