Skip to content

Commit

Permalink
additional case
Browse files Browse the repository at this point in the history
  • Loading branch information
davidporter-id-au committed Oct 29, 2024
1 parent e263242 commit 1293d33
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions service/history/execution/mutable_state_builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2157,6 +2157,38 @@ func TestMutableStateBuilder_closeTransactionHandleWorkflowReset(t *testing.T) {
assert.Equal(t, []persistence.Task(nil), m.insertTransferTasks)
},
},
"Transaction policy passive - no expected resets": {
policyIn: TransactionPolicyPassive,
shardContextExpectations: func(mockCache *events.MockCache, shardContext *shardCtx.MockContext, mockDomainCache *cache.MockDomainCache) {
shardContext.EXPECT().GetClusterMetadata().Return(cluster.TestActiveClusterMetadata).Times(2)
shardContext.EXPECT().GetEventsCache().Return(mockCache)
shardContext.EXPECT().GetConfig().Return(&config.Config{
NumberOfShards: 2,
IsAdvancedVisConfigExist: false,
MaxResponseSize: 0,
MutableStateChecksumInvalidateBefore: dynamicconfig.GetFloatPropertyFn(10),
MutableStateChecksumVerifyProbability: dynamicconfig.GetIntPropertyFilteredByDomain(0.0),
HostName: "test-host",
}).Times(1)
shardContext.EXPECT().GetTimeSource().Return(clock.NewMockedTimeSource())
shardContext.EXPECT().GetMetricsClient().Return(metrics.NewNoopMetricsClient())
shardContext.EXPECT().GetDomainCache().Return(mockDomainCache).Times(1)
},
mutableStateBuilderStartingState: func(m *mutableStateBuilder) {
// the workflow's running
m.executionInfo = &persistence.WorkflowExecutionInfo{
CloseStatus: persistence.WorkflowCloseStatusNone,
}

// there's some child workflow that's due to be updated
m.pendingChildExecutionInfoIDs = map[int64]*persistence.ChildExecutionInfo{
1: &persistence.ChildExecutionInfo{},
}
},
expectedEndState: func(t *testing.T, m *mutableStateBuilder) {
assert.Equal(t, []persistence.Task(nil), m.insertTransferTasks)
},
},
}

for name, td := range tests {
Expand Down

0 comments on commit 1293d33

Please sign in to comment.