@@ -152,35 +152,35 @@ func (s *mutableStateSuite) TestPropagateTimeSkippingToNextRun_FastForwardInfo()
152152 s .Run ("SkipCountAloneStillPropagates" , func () {
153153 tsc , stateProp := propagateTimeSkippingToNextRun (& persistencespb.WorkflowExecutionInfo {
154154 TimeSkippingInfo : & persistencespb.TimeSkippingInfo {
155- Config : & commonpb.TimeSkippingConfig {Enabled : true , MaxSkipPerSession : 50 },
155+ Config : & commonpb.TimeSkippingConfig {Enabled : true , MaxSessionSkipCount : 50 },
156156 SessionSkipCount : 2 ,
157157 },
158158 })
159159 s .Require ().NotNil (tsc )
160160 s .Require ().NotNil (stateProp )
161161 s .Nil (stateProp .GetInitialSkippedDuration ())
162162 s .Equal (int32 (2 ), stateProp .GetInitialSkipCount ())
163- s .Equal (int32 (50 ), tsc .MaxSkipPerSession )
163+ s .Equal (int32 (50 ), tsc .MaxSessionSkipCount )
164164 })
165165
166166 s .Run ("FullPropagationOfAllTimeSippingStates" , func () {
167167 tsc , stateProp := propagateTimeSkippingToNextRun (& persistencespb.WorkflowExecutionInfo {
168168 TimeSkippingInfo : & persistencespb.TimeSkippingInfo {
169- Config : & commonpb.TimeSkippingConfig {Enabled : true , MaxSkipPerSession : 50 },
169+ Config : & commonpb.TimeSkippingConfig {Enabled : true , MaxSessionSkipCount : 50 },
170170 AccumulatedSkippedDuration : durationpb .New (time .Hour ),
171171 SessionSkipCount : 3 ,
172172 },
173173 })
174174 s .Require ().NotNil (tsc )
175- s .Equal (int32 (50 ), tsc .GetMaxSkipPerSession ())
175+ s .Equal (int32 (50 ), tsc .GetMaxSessionSkipCount ())
176176 s .Require ().NotNil (stateProp )
177177 s .Equal (int32 (3 ), stateProp .GetInitialSkipCount ())
178178 })
179179
180180 s .Run ("SessionSkipCountPropagatesEvenWhenDisabled" , func () {
181181 tsc , stateProp := propagateTimeSkippingToNextRun (& persistencespb.WorkflowExecutionInfo {
182182 TimeSkippingInfo : & persistencespb.TimeSkippingInfo {
183- Config : & commonpb.TimeSkippingConfig {Enabled : false , MaxSkipPerSession : 50 },
183+ Config : & commonpb.TimeSkippingConfig {Enabled : false , MaxSessionSkipCount : 50 },
184184 AccumulatedSkippedDuration : durationpb .New (time .Hour ),
185185 SessionSkipCount : 3 ,
186186 },
@@ -215,9 +215,9 @@ func (s *mutableStateSuite) TestSnapshotTimeSkippingInfo_ForChildWorkflows() {
215215 return & persistencespb.WorkflowExecutionInfo {
216216 TimeSkippingInfo : & persistencespb.TimeSkippingInfo {
217217 Config : & commonpb.TimeSkippingConfig {
218- Enabled : true ,
219- FastForward : durationpb .New (3 * time .Hour ),
220- MaxSkipPerSession : sessionMaxSkipCount ,
218+ Enabled : true ,
219+ FastForward : durationpb .New (3 * time .Hour ),
220+ MaxSessionSkipCount : sessionMaxSkipCount ,
221221 },
222222 AccumulatedSkippedDuration : durationpb .New (accumSkip ),
223223 SessionSkipCount : 3 ,
@@ -245,7 +245,7 @@ func (s *mutableStateSuite) TestSnapshotTimeSkippingInfo_ForChildWorkflows() {
245245 // has virtual time
246246 s .Equal (accumSkip , propagatedState .GetInitialSkippedDuration ().AsDuration ())
247247 // has config of max skip
248- s .Equal (sessionMaxSkipCount , tsc .GetMaxSkipPerSession ())
248+ s .Equal (sessionMaxSkipCount , tsc .GetMaxSessionSkipCount ())
249249 // no accumulated session skip
250250 s .Equal (int32 (0 ), propagatedState .GetInitialSkipCount ())
251251 })
@@ -463,7 +463,6 @@ func (s *mutableStateSuite) TestInitTimeSkippingInfo() {
463463 s .Require ().NotNil (tsi )
464464 s .True (proto .Equal (cfg , tsi .GetConfig ()))
465465 s .Require ().NotNil (tsi .GetFastForwardInfo ())
466- s .Require ().Equal (enumspb .TIME_SKIPPING_STOP_REASON_UNSPECIFIED , tsi .GetStopReason ())
467466 s .Require ().Nil (tsi .GetAccumulatedSkippedDuration ())
468467 // timestamppb translates to UTC time
469468 s .Require ().Equal (baseTime .Add (3 * time .Hour ).UTC (),
@@ -517,7 +516,6 @@ func (s *mutableStateSuite) TestInitTimeSkippingInfo() {
517516 s .Nil (tsi .GetConfig ())
518517 s .Equal (hasSkipped , tsi .GetAccumulatedSkippedDuration ().AsDuration ())
519518 s .Equal (baseTime .Add (hasSkipped ), s .mutableState .Now (), "inherited skip still shifts the virtual clock" )
520- s .Equal (enumspb .TIME_SKIPPING_STOP_REASON_UNSPECIFIED , tsi .GetStopReason ())
521519 })
522520
523521 s .Run ("SessionSkipCountSeededFromPropagation" , func () {
@@ -596,7 +594,6 @@ func (s *mutableStateSuite) TestUpdateTimeSkippingInfo() {
596594 Enabled : false ,
597595 },
598596 AccumulatedSkippedDuration : durationpb .New (time .Hour ),
599- StopReason : enumspb .TIME_SKIPPING_STOP_REASON_USER_DISABLED ,
600597 }
601598 s .mutableState .executionInfo .TimeSkippingInfo = & currentTSI
602599
@@ -611,7 +608,6 @@ func (s *mutableStateSuite) TestUpdateTimeSkippingInfo() {
611608
612609 s .Require ().NotNil (newTSI )
613610 s .True (proto .Equal (newConfig , newTSI .GetConfig ()))
614- s .Equal (enumspb .TIME_SKIPPING_STOP_REASON_UNSPECIFIED , newTSI .GetStopReason (), "re-enabling clears the prior stop reason" )
615611 s .Require ().NotNil (newTSI .GetFastForwardInfo ())
616612 // re-installing the fast-forward records the current versioned transition, so a task
617613 // emitted here validates against a stable reference after a failover.
@@ -668,8 +664,6 @@ func (s *mutableStateSuite) TestUpdateTimeSkippingInfo() {
668664 s .True (proto .Equal (tsc3 , tsc3TSI .GetConfig ()))
669665 s .Nil (tsc3TSI .GetFastForwardInfo ())
670666 s .Equal (time .Hour , tsc3TSI .GetAccumulatedSkippedDuration ().AsDuration ())
671- s .Equal (enumspb .TIME_SKIPPING_STOP_REASON_USER_DISABLED , tsc3TSI .GetStopReason ())
672-
673667 })
674668
675669 // Updating the config restarts the skip session: the per-session skip counter from the
@@ -678,13 +672,13 @@ func (s *mutableStateSuite) TestUpdateTimeSkippingInfo() {
678672 s .mutableState .timeSource = clock .NewEventTimeSource ()
679673 s .mutableState .executionInfo .TimeSkippingInfo = & persistencespb.TimeSkippingInfo {
680674 Config : & commonpb.TimeSkippingConfig {
681- Enabled : false ,
682- MaxSkipPerSession : 10 ,
675+ Enabled : false ,
676+ MaxSessionSkipCount : 10 ,
683677 },
684678 SessionSkipCount : 7 ,
685679 }
686680
687- s .mutableState .updateTimeSkippingInfo (& commonpb.TimeSkippingConfig {Enabled : true , MaxSkipPerSession : 10 })
681+ s .mutableState .updateTimeSkippingInfo (& commonpb.TimeSkippingConfig {Enabled : true , MaxSessionSkipCount : 10 })
688682
689683 tsi := s .mutableState .executionInfo .GetTimeSkippingInfo ()
690684 s .Require ().NotNil (tsi )
@@ -1417,16 +1411,15 @@ func (s *mutableStateSuite) TestApplyWorkflowExecutionTimeSkippingTransitionedEv
14171411 tsi := s .mutableState .GetExecutionInfo ().TimeSkippingInfo
14181412 s .Require ().False (tsi .GetConfig ().GetEnabled ())
14191413 s .Require ().True (tsi .GetFastForwardInfo ().GetHasReached ())
1420- s .Require ().Equal (enumspb .TIME_SKIPPING_STOP_REASON_FAST_FORWARD_COMPLETED , tsi .GetStopReason ())
14211414 })
14221415
14231416 // Every applied transition increments SessionSkipCount by one, and once the count reaches
14241417 // the per-session cap the config is disabled.
14251418 s .Run ("SessionSkipCountIncrementsUntilCapDisables" , func () {
14261419 s .mutableState .executionInfo .TimeSkippingInfo = & persistencespb.TimeSkippingInfo {
14271420 Config : & commonpb.TimeSkippingConfig {
1428- Enabled : true ,
1429- MaxSkipPerSession : 2 ,
1421+ Enabled : true ,
1422+ MaxSessionSkipCount : 2 ,
14301423 },
14311424 }
14321425 targetTime := baseTime .Add (time .Hour )
@@ -1440,7 +1433,6 @@ func (s *mutableStateSuite) TestApplyWorkflowExecutionTimeSkippingTransitionedEv
14401433 tsi := s .mutableState .GetExecutionInfo ().TimeSkippingInfo
14411434 s .Require ().Equal (int32 (1 ), tsi .GetSessionSkipCount ())
14421435 s .Require ().True (tsi .GetConfig ().GetEnabled ())
1443- s .Require ().Equal (enumspb .TIME_SKIPPING_STOP_REASON_UNSPECIFIED , tsi .GetStopReason ())
14441436
14451437 // second skip: count reaches the cap of 2, disables
14461438 err = s .mutableState .ApplyWorkflowExecutionTimeSkippingTransitionedEvent (
@@ -1450,7 +1442,6 @@ func (s *mutableStateSuite) TestApplyWorkflowExecutionTimeSkippingTransitionedEv
14501442 s .Require ().NoError (err )
14511443 s .Require ().Equal (int32 (2 ), tsi .GetSessionSkipCount ())
14521444 s .Require ().False (tsi .GetConfig ().GetEnabled ())
1453- s .Require ().Equal (enumspb .TIME_SKIPPING_STOP_REASON_MAX_SKIP_PER_SESSION_REACHED , tsi .GetStopReason ())
14541445 })
14551446
14561447 // A MaxSkipPerSession of 0 caps on the very first skip (1 >= 0), disabling immediately.
@@ -1471,7 +1462,6 @@ func (s *mutableStateSuite) TestApplyWorkflowExecutionTimeSkippingTransitionedEv
14711462 tsi := s .mutableState .GetExecutionInfo ().TimeSkippingInfo
14721463 s .Require ().Equal (int32 (1 ), tsi .GetSessionSkipCount ())
14731464 s .Require ().False (tsi .GetConfig ().GetEnabled ())
1474- s .Require ().Equal (enumspb .TIME_SKIPPING_STOP_REASON_MAX_SKIP_PER_SESSION_REACHED , tsi .GetStopReason ())
14751465 })
14761466}
14771467
@@ -1683,7 +1673,6 @@ func (s *mutableStateSuite) TestTimeSkippingInfoUtil() {
16831673 s .True (info .GetIsRunning ())
16841674 s .Equal (now , info .GetCurrentTime ().AsTime ())
16851675 s .Nil (info .GetFastForwardInfo (), "no fast-forward set" )
1686- s .Equal (enumspb .TIME_SKIPPING_STOP_REASON_UNSPECIFIED , info .GetStopReason (), "no stop reason while running" )
16871676 })
16881677
16891678 s .Run ("ToDescribeInfoWithFastForward" , func () {
@@ -1712,14 +1701,12 @@ func (s *mutableStateSuite) TestTimeSkippingInfoUtil() {
17121701 util := NewTimeSkippingInfoUtil (& persistencespb.TimeSkippingInfo {
17131702 Config : & commonpb.TimeSkippingConfig {Enabled : false },
17141703 AccumulatedSkippedDuration : durationpb .New (2 * time .Hour ),
1715- StopReason : enumspb .TIME_SKIPPING_STOP_REASON_USER_DISABLED ,
17161704 })
17171705 msNow := time .Date (2027 , 1 , 1 , 12 , 0 , 0 , 0 , time .UTC )
17181706 info := util .ToDescribeInfo (msNow )
17191707 s .NotNil (info )
17201708 s .False (info .GetIsRunning ())
17211709 s .Equal (msNow , info .GetCurrentTime ().AsTime ())
1722- s .Equal (enumspb .TIME_SKIPPING_STOP_REASON_USER_DISABLED , info .GetStopReason ())
17231710 })
17241711
17251712}
0 commit comments