@@ -200,7 +200,7 @@ func TestHandleDecisionTaskScheduled(t *testing.T) {
200
200
Times (1 ).
201
201
Return (& types.HistoryEvent {}, nil )
202
202
shardContext .EXPECT ().GetShardID ().Return (testShardID ).Times (1 )
203
- shardContext .EXPECT ().GenerateTransferTaskIDs (gomock .Any ()).Times (1 ).Return ([]int64 {}, errors .New ("some random error to avoid going too deep in call stack unrelated to this unit" ))
203
+ shardContext .EXPECT ().GenerateTaskIDs (gomock .Any ()).Times (1 ).Return ([]int64 {}, errors .New ("some random error to avoid going too deep in call stack unrelated to this unit" ))
204
204
},
205
205
expectErr : true ,
206
206
isfirstDecision : true ,
@@ -222,7 +222,7 @@ func TestHandleDecisionTaskScheduled(t *testing.T) {
222
222
Times (1 ).
223
223
Return (& types.HistoryEvent {}, nil )
224
224
shardContext .EXPECT ().GetShardID ().Return (testShardID ).Times (1 )
225
- shardContext .EXPECT ().GenerateTransferTaskIDs (gomock .Any ()).Times (1 ).Return ([]int64 {}, errors .New ("some random error to avoid going too deep in call stack unrelated to this unit" ))
225
+ shardContext .EXPECT ().GenerateTaskIDs (gomock .Any ()).Times (1 ).Return ([]int64 {}, errors .New ("some random error to avoid going too deep in call stack unrelated to this unit" ))
226
226
},
227
227
expectErr : true ,
228
228
isfirstDecision : true ,
@@ -301,7 +301,7 @@ func TestHandleDecisionTaskFailed(t *testing.T) {
301
301
}
302
302
h .tokenSerializer .(* common.MockTaskTokenSerializer ).EXPECT ().Deserialize (taskToken ).Return (token , nil )
303
303
h .shard .(* shard.MockContext ).EXPECT ().GetEventsCache ().Times (1 ).Return (events .NewMockCache (ctrl ))
304
- h .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (gomock .Any ()).Return ([]int64 {0 }, nil )
304
+ h .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (gomock .Any ()).Return ([]int64 {0 }, nil )
305
305
h .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , types.WorkflowExecution {
306
306
WorkflowID : constants .TestWorkflowID ,
307
307
RunID : constants .TestRunID ,
@@ -494,7 +494,7 @@ func TestHandleDecisionTaskStarted(t *testing.T) {
494
494
domainID : constants .TestDomainID ,
495
495
expectCalls : func (ctrl * gomock.Controller , h * handlerImpl ) {
496
496
h .shard .(* shard.MockContext ).EXPECT ().GetEventsCache ().Times (1 ).Return (events .NewMockCache (ctrl ))
497
- h .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (gomock .Any ()).Times (1 ).Return ([]int64 {0 }, nil )
497
+ h .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (gomock .Any ()).Times (1 ).Return ([]int64 {0 }, nil )
498
498
h .shard .(* shard.MockContext ).EXPECT ().
499
499
AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , types.WorkflowExecution {WorkflowID : constants .TestWorkflowID , RunID : constants .TestRunID }).
500
500
Return (& persistence.AppendHistoryNodesResponse {}, nil )
@@ -639,8 +639,8 @@ func TestHandleDecisionTaskCompleted(t *testing.T) {
639
639
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetEventsCache ().Times (1 ).Return (eventsCache )
640
640
eventsCache .EXPECT ().PutEvent (constants .TestDomainID , constants .TestWorkflowID , constants .TestRunID , int64 (1 ), gomock .Any ())
641
641
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetShardID ().Times (1 ).Return (testShardID )
642
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (4 ).Return ([]int64 {0 , 1 , 2 , 3 }, nil )
643
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (6 ).Return ([]int64 {0 , 1 , 2 , 3 , 4 , 5 }, nil )
642
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (4 ).Return ([]int64 {0 , 1 , 2 , 3 }, nil )
643
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (6 ).Return ([]int64 {0 , 1 , 2 , 3 , 4 , 5 }, nil )
644
644
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , types.WorkflowExecution {
645
645
WorkflowID : constants .TestWorkflowID ,
646
646
RunID : constants .TestRunID ,
@@ -769,7 +769,7 @@ func TestHandleDecisionTaskCompleted(t *testing.T) {
769
769
eventsCache := events .NewMockCache (ctrl )
770
770
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetEventsCache ().Times (1 ).Return (eventsCache )
771
771
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetShardID ().Times (1 ).Return (testShardID )
772
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (1 ).Return ([]int64 {0 }, nil )
772
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (1 ).Return ([]int64 {0 }, nil )
773
773
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , types.WorkflowExecution {
774
774
WorkflowID : constants .TestWorkflowID ,
775
775
RunID : constants .TestRunID ,
@@ -822,7 +822,7 @@ func TestHandleDecisionTaskCompleted(t *testing.T) {
822
822
eventsCache .EXPECT ().GetEvent (context .Background (), testShardID , constants .TestDomainID , constants .TestWorkflowID , constants .TestRunID , commonconstants .FirstEventID , commonconstants .FirstEventID , nil ).Return (& types.HistoryEvent {}, nil )
823
823
eventsCache .EXPECT ().PutEvent (constants .TestDomainID , constants .TestWorkflowID , gomock .Any (), int64 (1 ), gomock .Any ()).Times (2 )
824
824
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetShardID ().Times (1 ).Return (testShardID )
825
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (2 ).Times (1 ).Return ([]int64 {0 , 1 }, nil )
825
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (2 ).Times (1 ).Return ([]int64 {0 , 1 }, nil )
826
826
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , gomock .Any ()).Return (nil , & persistence.TransactionSizeLimitError {Msg : fmt .Sprintf ("transaction size exceeds limit" )})
827
827
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetExecutionManager ().Times (1 )
828
828
},
@@ -863,7 +863,7 @@ func TestHandleDecisionTaskCompleted(t *testing.T) {
863
863
}, nil ).Times (3 )
864
864
eventsCache .EXPECT ().PutEvent (constants .TestDomainID , constants .TestWorkflowID , gomock .Any (), int64 (1 ), gomock .Any ()).Times (2 )
865
865
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetShardID ().Times (3 ).Return (testShardID )
866
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (2 ).Times (1 ).Return ([]int64 {0 , 1 }, nil )
866
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (2 ).Times (1 ).Return ([]int64 {0 , 1 }, nil )
867
867
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , gomock .Any ()).Return (nil , execution .NewConflictError (new (testing.T ), errors .New ("some random conflict error" )))
868
868
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetExecutionManager ().Times (1 )
869
869
},
@@ -904,7 +904,7 @@ func TestHandleDecisionTaskCompleted(t *testing.T) {
904
904
}, nil ).Times (3 )
905
905
eventsCache .EXPECT ().PutEvent (constants .TestDomainID , constants .TestWorkflowID , gomock .Any (), int64 (1 ), gomock .Any ()).Times (2 )
906
906
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetShardID ().Times (3 ).Return (testShardID )
907
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (2 ).Times (1 ).Return ([]int64 {0 , 1 }, nil )
907
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (2 ).Times (1 ).Return ([]int64 {0 , 1 }, nil )
908
908
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , gomock .Any ()).Return (nil , & persistence.TransactionSizeLimitError {Msg : fmt .Sprintf ("transaction size exceeds limit" )})
909
909
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetExecutionManager ().Times (1 )
910
910
firstGetWfExecutionCall := decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetWorkflowExecution (context .Background (), gomock .Any ()).
@@ -955,8 +955,8 @@ func TestHandleDecisionTaskCompleted(t *testing.T) {
955
955
}, nil ).Times (3 )
956
956
eventsCache .EXPECT ().PutEvent (constants .TestDomainID , constants .TestWorkflowID , gomock .Any (), int64 (1 ), gomock .Any ()).Times (3 )
957
957
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetShardID ().Times (3 ).Return (testShardID )
958
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (2 ).Times (2 ).Return ([]int64 {0 , 1 }, nil )
959
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (1 ).Times (1 ).Return ([]int64 {0 }, nil )
958
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (2 ).Times (2 ).Return ([]int64 {0 , 1 }, nil )
959
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (1 ).Times (1 ).Return ([]int64 {0 }, nil )
960
960
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , gomock .Any ()).Return (nil , & persistence.TransactionSizeLimitError {Msg : fmt .Sprintf ("transaction size exceeds limit" )})
961
961
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , gomock .Any ()).Return (& persistence.AppendHistoryNodesResponse {}, nil )
962
962
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetExecutionManager ().Times (1 )
@@ -999,7 +999,7 @@ func TestHandleDecisionTaskCompleted(t *testing.T) {
999
999
eventsCache := events .NewMockCache (ctrl )
1000
1000
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetEventsCache ().Times (3 ).Return (eventsCache )
1001
1001
eventsCache .EXPECT ().PutEvent (constants .TestDomainID , constants .TestWorkflowID , constants .TestRunID , int64 (0 ), gomock .Any ())
1002
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (1 ).Return ([]int64 {0 }, nil )
1002
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (1 ).Return ([]int64 {0 }, nil )
1003
1003
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , gomock .Any ()).Return (nil , errors .New ("some error updating continue as new info" ))
1004
1004
domainEntry := cache .NewLocalDomainCacheEntryForTest (
1005
1005
& persistence.DomainInfo {ID : constants .TestDomainID , Name : constants .TestDomainName },
@@ -1146,7 +1146,7 @@ func TestHandleDecisionTaskCompleted(t *testing.T) {
1146
1146
decisionHandler .tokenSerializer .(* common.MockTaskTokenSerializer ).EXPECT ().Deserialize (serializedTestToken ).Return (deserializedTestToken , nil )
1147
1147
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetEventsCache ().Times (1 ).Return (events .NewMockCache (ctrl ))
1148
1148
decisionHandler .shard .(* shard.MockContext ).EXPECT ().GetShardID ().Times (1 ).Return (testShardID )
1149
- decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTransferTaskIDs (3 ).Return ([]int64 {0 , 1 , 2 }, nil )
1149
+ decisionHandler .shard .(* shard.MockContext ).EXPECT ().GenerateTaskIDs (3 ).Return ([]int64 {0 , 1 , 2 }, nil )
1150
1150
decisionHandler .shard .(* shard.MockContext ).EXPECT ().AppendHistoryV2Events (gomock .Any (), gomock .Any (), constants .TestDomainID , types.WorkflowExecution {
1151
1151
WorkflowID : constants .TestWorkflowID ,
1152
1152
RunID : constants .TestRunID ,
0 commit comments