@@ -13,6 +13,7 @@ import (
1313 historypb "go.temporal.io/api/history/v1"
1414 "go.temporal.io/api/serviceerror"
1515 updatepb "go.temporal.io/api/update/v1"
16+ workflowpb "go.temporal.io/api/workflow/v1"
1617 enumsspb "go.temporal.io/server/api/enums/v1"
1718 persistencespb "go.temporal.io/server/api/persistence/v1"
1819 "go.temporal.io/server/common/definition"
@@ -129,6 +130,54 @@ func (s *nDCEventReapplicationSuite) TestReapplyEvents_AppliedEvent_WorkflowExec
129130 s .Equal (1 , len (appliedEvent ))
130131}
131132
133+ func (s * nDCEventReapplicationSuite ) TestReapplyEvents_AppliedEvent_WorkflowExecutionOptionsUpdated_WithTimeSkippingConfig () {
134+ runID := uuid .NewString ()
135+ execution := & persistencespb.WorkflowExecutionInfo {
136+ NamespaceId : uuid .NewString (),
137+ }
138+ timeSkippingConfig := & workflowpb.TimeSkippingConfig {Enabled : true }
139+ event := & historypb.HistoryEvent {
140+ EventId : 1 ,
141+ EventType : enumspb .EVENT_TYPE_WORKFLOW_EXECUTION_OPTIONS_UPDATED ,
142+ Attributes : & historypb.HistoryEvent_WorkflowExecutionOptionsUpdatedEventAttributes {
143+ WorkflowExecutionOptionsUpdatedEventAttributes : & historypb.WorkflowExecutionOptionsUpdatedEventAttributes {
144+ AttachedRequestId : "test-attached-request-id" ,
145+ TimeSkippingConfig : timeSkippingConfig ,
146+ },
147+ },
148+ }
149+ attr := event .GetWorkflowExecutionOptionsUpdatedEventAttributes ()
150+
151+ msCurrent := historyi .NewMockMutableState (s .controller )
152+ msCurrent .EXPECT ().VisitUpdates (gomock .Any ()).Return ()
153+ msCurrent .EXPECT ().GetCurrentVersion ().Return (int64 (0 ))
154+ updateRegistry := update .NewRegistry (msCurrent )
155+ msCurrent .EXPECT ().IsWorkflowExecutionRunning ().Return (true ).Times (2 )
156+ msCurrent .EXPECT ().GetExecutionInfo ().Return (execution ).AnyTimes ()
157+ msCurrent .EXPECT ().AddWorkflowExecutionOptionsUpdatedEvent (
158+ attr .GetVersioningOverride (),
159+ attr .GetUnsetVersioningOverride (),
160+ attr .GetAttachedRequestId (),
161+ attr .GetAttachedCompletionCallbacks (),
162+ event .Links ,
163+ attr .GetIdentity (),
164+ attr .GetPriority (),
165+ timeSkippingConfig ,
166+ ).Return (event , nil )
167+ msCurrent .EXPECT ().HSM ().Return (s .hsmNode ).AnyTimes ()
168+ msCurrent .EXPECT ().IsWorkflowPendingOnWorkflowTaskBackoff ().Return (true )
169+ dedupResource := definition .NewEventReappliedID (runID , event .GetEventId (), event .GetVersion ())
170+ msCurrent .EXPECT ().IsResourceDuplicated (dedupResource ).Return (false )
171+ msCurrent .EXPECT ().UpdateDuplicatedResource (dedupResource )
172+ events := []* historypb.HistoryEvent {
173+ {EventType : enumspb .EVENT_TYPE_WORKFLOW_EXECUTION_STARTED },
174+ event ,
175+ }
176+ appliedEvent , err := s .nDCReapplication .ReapplyEvents (context .Background (), msCurrent , updateRegistry , events , runID )
177+ s .NoError (err )
178+ s .Equal (1 , len (appliedEvent ))
179+ }
180+
132181func (s * nDCEventReapplicationSuite ) TestReapplyEvents_AppliedEvent_Signal () {
133182 runID := uuid .NewString ()
134183 execution := & persistencespb.WorkflowExecutionInfo {
0 commit comments