Skip to content

Commit f46c30b

Browse files
authored
Fix TestQueryTask_WorkflowCacheEvicted (#1140)
1 parent 338aad0 commit f46c30b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

internal/internal_workers_test.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,15 @@ func (s *WorkersTestSuite) TestQueryTask_WorkflowCacheEvicted() {
512512
DisableActivityWorker: true,
513513
Identity: "test-worker-identity",
514514
DataConverter: dc,
515+
// set concurrent decision task execution to 1,
516+
// otherwise query task may be polled and start execution
517+
// before decision task put created workflowContext into the cache,
518+
// resulting in a cache hit for query
519+
// by setting concurrent execution size to 1, we ensure when polling
520+
// query task, cache already contains the workflowContext for this workflow,
521+
// and we can force clear the cache when polling the query task.
522+
// See the mock function for the second PollForDecisionTask call above.
523+
MaxConcurrentDecisionTaskExecutionSize: 1,
515524
}
516525
worker := newAggregatedWorker(s.service, domain, taskList, options)
517526
worker.RegisterWorkflowWithOptions(

0 commit comments

Comments
 (0)