@@ -89,17 +89,32 @@ func (s *apiSuite) TestWorkflowRunning_ActivityTaskStarted() {
8989func (s * apiSuite ) TestWorkflowRunning_ActivityTaskStampMismatch () {
9090 s .mutableState .EXPECT ().IsWorkflowExecutionRunning ().Return (true )
9191 activityScheduleEventID := rand .Int63 ()
92+ const storedStamp = int32 (456 )
9293 s .mutableState .EXPECT ().GetActivityInfo (activityScheduleEventID ).Return (& persistencespb.ActivityInfo {
9394 ScheduledEventId : activityScheduleEventID ,
9495 StartedEventId : common .EmptyEventID ,
95- Stamp : rand . Int31 () ,
96+ Stamp : storedStamp ,
9697 }, true )
9798
98- valid , err := isActivityTaskValid (s .workflowLease , activityScheduleEventID , rand . Int31 () )
99+ valid , err := isActivityTaskValid (s .workflowLease , activityScheduleEventID , storedStamp + 1 )
99100 s .NoError (err )
100101 s .False (valid )
101102}
102103
104+ func (s * apiSuite ) TestWorkflowRunning_ActivityTaskStampLegacy () {
105+ s .mutableState .EXPECT ().IsWorkflowExecutionRunning ().Return (true )
106+ activityScheduleEventID := rand .Int63 ()
107+ s .mutableState .EXPECT ().GetActivityInfo (activityScheduleEventID ).Return (& persistencespb.ActivityInfo {
108+ ScheduledEventId : activityScheduleEventID ,
109+ StartedEventId : common .EmptyEventID ,
110+ Stamp : 0 ,
111+ }, true )
112+
113+ valid , err := isActivityTaskValid (s .workflowLease , activityScheduleEventID , 0 )
114+ s .NoError (err )
115+ s .True (valid )
116+ }
117+
103118func (s * apiSuite ) TestWorkflowRunning_ActivityTaskMissing () {
104119 s .mutableState .EXPECT ().IsWorkflowExecutionRunning ().Return (true )
105120 activityScheduleEventID := rand .Int63 ()
0 commit comments