Skip to content

Commit 6db8982

Browse files
authored
Fix TestActivityWorkerStop: it times out with go 1.20 (#1223)
The only test that fails with go 1.20 is this one. The reason is workerOptions.WorkerActivitiesPerSecond == 0, and it is not augmented in newActivityWorker() - this supposed to be done in callers. This breaks task-dispatching: polled tasks are never executed since it is always above the limit(0).
1 parent 5a23998 commit 6db8982

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

internal/internal_workers_test.go

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,13 @@ func (s *WorkersTestSuite) TestActivityWorkerStop() {
168168
ctx, cancel := context.WithCancel(context.Background())
169169
executionParameters := workerExecutionParameters{
170170
TaskList: "testTaskList",
171-
WorkerOptions: WorkerOptions{
172-
MaxConcurrentActivityTaskPollers: 5,
173-
MaxConcurrentActivityExecutionSize: 2,
174-
Logger: zaptest.NewLogger(s.T())},
171+
WorkerOptions: augmentWorkerOptions(
172+
WorkerOptions{
173+
MaxConcurrentActivityTaskPollers: 5,
174+
MaxConcurrentActivityExecutionSize: 2,
175+
Logger: zaptest.NewLogger(s.T()),
176+
},
177+
),
175178
UserContext: ctx,
176179
UserContextCancel: cancel,
177180
WorkerStopTimeout: time.Second * 2,

0 commit comments

Comments
 (0)