@@ -234,7 +234,7 @@ func (t *TaskHandlersTestSuite) testWorkflowTaskWorkflowExecutionStartedHelper(p
234234 }
235235 task := createWorkflowTask (testEvents , 0 , "HelloWorld_Workflow" )
236236 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
237- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
237+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
238238 response := request .(* s.RespondDecisionTaskCompletedRequest )
239239 t .NoError (err )
240240 t .NotNil (response )
@@ -286,7 +286,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_ActivityTaskScheduled() {
286286 Logger : t .logger ,
287287 }
288288 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
289- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
289+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
290290 response := request .(* s.RespondDecisionTaskCompletedRequest )
291291
292292 t .NoError (err )
@@ -297,7 +297,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_ActivityTaskScheduled() {
297297
298298 // Schedule an activity and see if we complete workflow, Having only one last decision.
299299 task = createWorkflowTask (testEvents , 3 , "HelloWorld_Workflow" )
300- request , _ , err = taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
300+ request , err = taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
301301 response = request .(* s.RespondDecisionTaskCompletedRequest )
302302 t .NoError (err )
303303 t .NotNil (response )
@@ -337,7 +337,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_QueryWorkflow_Sticky() {
337337 task := createWorkflowTask (testEvents [0 :1 ], 0 , "HelloWorld_Workflow" )
338338 task .StartedEventId = common .Int64Ptr (1 )
339339 task .WorkflowExecution = execution
340- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
340+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
341341 response := request .(* s.RespondDecisionTaskCompletedRequest )
342342 t .NoError (err )
343343 t .NotNil (response )
@@ -348,7 +348,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_QueryWorkflow_Sticky() {
348348 // then check the current state using query task
349349 task = createQueryTask ([]* s.HistoryEvent {}, 6 , "HelloWorld_Workflow" , "test-query" )
350350 task .WorkflowExecution = execution
351- queryResp , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
351+ queryResp , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
352352 t .NoError (err )
353353 t .verifyQueryResult (queryResp , "waiting-activity-result" )
354354}
@@ -380,30 +380,30 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_QueryWorkflow_NonSticky() {
380380 // query after first decision task (notice the previousStartEventID is always the last eventID for query task)
381381 task := createQueryTask (testEvents [0 :3 ], 3 , "HelloWorld_Workflow" , "test-query" )
382382 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
383- response , _ , _ := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
383+ response , _ := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
384384 t .verifyQueryResult (response , "waiting-activity-result" )
385385
386386 // query after activity task complete but before second decision task started
387387 task = createQueryTask (testEvents [0 :7 ], 7 , "HelloWorld_Workflow" , "test-query" )
388388 taskHandler = newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
389- response , _ , _ = taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
389+ response , _ = taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
390390 t .verifyQueryResult (response , "waiting-activity-result" )
391391
392392 // query after second decision task
393393 task = createQueryTask (testEvents [0 :8 ], 8 , "HelloWorld_Workflow" , "test-query" )
394394 taskHandler = newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
395- response , _ , _ = taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
395+ response , _ = taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
396396 t .verifyQueryResult (response , "done" )
397397
398398 // query after second decision task with extra events
399399 task = createQueryTask (testEvents [0 :9 ], 9 , "HelloWorld_Workflow" , "test-query" )
400400 taskHandler = newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
401- response , _ , _ = taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
401+ response , _ = taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
402402 t .verifyQueryResult (response , "done" )
403403
404404 task = createQueryTask (testEvents [0 :9 ], 9 , "HelloWorld_Workflow" , "invalid-query-type" )
405405 taskHandler = newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
406- response , _ , _ = taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
406+ response , _ = taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
407407 t .NotNil (response )
408408 queryResp , ok := response .(* s.RespondQueryTaskCompletedRequest )
409409 t .True (ok )
@@ -451,7 +451,7 @@ func (t *TaskHandlersTestSuite) TestCacheEvictionWhenErrorOccurs() {
451451 // newWorkflowTaskWorkerInternal will set the laTunnel in taskHandler, without it, ProcessWorkflowTask()
452452 // will fail as it can't find laTunnel in getWorkflowCache().
453453 newWorkflowTaskWorkerInternal (taskHandler , t .service , testDomain , params , make (chan struct {}))
454- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
454+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
455455
456456 t .Error (err )
457457 t .Nil (request )
@@ -507,7 +507,7 @@ func (t *TaskHandlersTestSuite) testSideEffectDeferHelper(disableSticky bool) {
507507
508508 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
509509 task := createWorkflowTask (testEvents , 0 , workflowName )
510- _ , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
510+ _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
511511 t .Nil (err )
512512
513513 if ! params .DisableStickyExecution {
@@ -549,7 +549,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicDetection() {
549549 }
550550
551551 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
552- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
552+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
553553 response := request .(* s.RespondDecisionTaskCompletedRequest )
554554 // there should be no error as the history events matched the decisions.
555555 t .NoError (err )
@@ -561,7 +561,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicDetection() {
561561 // newWorkflowTaskWorkerInternal will set the laTunnel in taskHandler, without it, ProcessWorkflowTask()
562562 // will fail as it can't find laTunnel in getWorkflowCache().
563563 newWorkflowTaskWorkerInternal (taskHandler , t .service , testDomain , params , stopC )
564- request , _ , err = taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
564+ request , err = taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
565565 t .Error (err )
566566 t .Nil (request )
567567 t .Contains (err .Error (), "nondeterministic" )
@@ -571,7 +571,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicDetection() {
571571 params .NonDeterministicWorkflowPolicy = NonDeterministicWorkflowPolicyFailWorkflow
572572 failOnNondeterminismTaskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
573573 task = createWorkflowTask (testEvents , 3 , "HelloWorld_Workflow" )
574- request , _ , err = failOnNondeterminismTaskHandler .ProcessWorkflowTask (& workflowTask {task : task })
574+ request , err = failOnNondeterminismTaskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
575575 // When FailWorkflow policy is set, task handler does not return an error,
576576 // because it will indicate non determinism in the request.
577577 t .NoError (err )
@@ -589,7 +589,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_NondeterministicDetection() {
589589 // now with different package name to activity type
590590 testEvents [4 ].ActivityTaskScheduledEventAttributes .ActivityType .Name = common .StringPtr ("new-package.Greeter_Activity" )
591591 task = createWorkflowTask (testEvents , 3 , "HelloWorld_Workflow" )
592- request , _ , err = taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
592+ request , err = taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
593593 t .NoError (err )
594594 t .NotNil (request )
595595}
@@ -610,7 +610,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowReturnsPanicError() {
610610 }
611611
612612 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
613- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
613+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
614614 t .NoError (err )
615615 t .NotNil (request )
616616 r , ok := request .(* s.RespondDecisionTaskCompletedRequest )
@@ -638,7 +638,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_WorkflowPanics() {
638638 }
639639
640640 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
641- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
641+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
642642 t .NoError (err )
643643 t .NotNil (request )
644644 r , ok := request .(* s.RespondDecisionTaskFailedRequest )
@@ -690,7 +690,7 @@ func (t *TaskHandlersTestSuite) TestGetWorkflowInfo() {
690690 }
691691
692692 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
693- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
693+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
694694 t .NoError (err )
695695 t .NotNil (request )
696696 r , ok := request .(* s.RespondDecisionTaskCompletedRequest )
@@ -728,11 +728,10 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_CancelActivityBeforeSent() {
728728 Logger : t .logger ,
729729 }
730730 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
731- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task })
731+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task }, nil )
732732 response := request .(* s.RespondDecisionTaskCompletedRequest )
733733 t .NoError (err )
734734 t .NotNil (response )
735- //t.printAllDecisions(response.Decisions)
736735 t .Equal (1 , len (response .Decisions ))
737736 t .Equal (s .DecisionTypeCompleteWorkflowExecution , response .Decisions [0 ].GetDecisionType ())
738737 t .NotNil (response .Decisions [0 ].CompleteWorkflowExecutionDecisionAttributes )
@@ -764,7 +763,7 @@ func (t *TaskHandlersTestSuite) TestWorkflowTask_PageToken() {
764763 },
765764 }
766765 taskHandler := newWorkflowTaskHandler (testDomain , params , nil , getHostEnvironment ())
767- request , _ , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task , historyIterator : historyIterator })
766+ request , err := taskHandler .ProcessWorkflowTask (& workflowTask {task : task , historyIterator : historyIterator }, nil )
768767 response := request .(* s.RespondDecisionTaskCompletedRequest )
769768 t .NoError (err )
770769 t .NotNil (response )
0 commit comments