persistencetests

package
v1.2.14-prerelease14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 41 Imported by: 2

Documentation

Index

Constants

View Source
const TimePrecision = 2 * time.Millisecond

TimePrecision is needed to account for database timestamp precision. Cassandra only provides milliseconds timestamp precision, so we need to use tolerance when doing comparison

Variables

This section is empty.

Functions

func GenerateRandomDBName

func GenerateRandomDBName(n int) string

GenerateRandomDBName helper

Types

type ConfigStorePersistenceSuite added in v0.23.1

type ConfigStorePersistenceSuite struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
}

ConfigStorePersistenceSuite contains config store persistence tests

func (*ConfigStorePersistenceSuite) FetchDynamicConfig added in v0.23.1

func (s *ConfigStorePersistenceSuite) FetchDynamicConfig(ctx context.Context, rowType int) (*p.DynamicConfigSnapshot, error)

func (*ConfigStorePersistenceSuite) SetupSuite added in v0.23.1

func (s *ConfigStorePersistenceSuite) SetupSuite()

SetupSuite implementation

func (*ConfigStorePersistenceSuite) SetupTest added in v0.23.1

func (s *ConfigStorePersistenceSuite) SetupTest()

SetupTest implementation

func (*ConfigStorePersistenceSuite) TearDownSuite added in v0.23.1

func (s *ConfigStorePersistenceSuite) TearDownSuite()

TearDownSuite implementation

func (*ConfigStorePersistenceSuite) TestFetchFromEmptyTable added in v0.23.1

func (s *ConfigStorePersistenceSuite) TestFetchFromEmptyTable()

Tests if error is returned when trying to fetch dc values from empty table

func (*ConfigStorePersistenceSuite) TestFetchLatestVersionSuccess added in v0.23.1

func (s *ConfigStorePersistenceSuite) TestFetchLatestVersionSuccess()

func (*ConfigStorePersistenceSuite) TestUpdateIncrementalVersionSuccess added in v0.23.1

func (s *ConfigStorePersistenceSuite) TestUpdateIncrementalVersionSuccess()

func (*ConfigStorePersistenceSuite) TestUpdateSimpleSuccess added in v0.23.1

func (s *ConfigStorePersistenceSuite) TestUpdateSimpleSuccess()

func (*ConfigStorePersistenceSuite) TestUpdateVersionCollisionFailure added in v0.23.1

func (s *ConfigStorePersistenceSuite) TestUpdateVersionCollisionFailure()

func (*ConfigStorePersistenceSuite) UpdateDynamicConfig added in v0.23.1

func (s *ConfigStorePersistenceSuite) UpdateDynamicConfig(ctx context.Context, snapshot *p.DynamicConfigSnapshot, rowType int) error

type DBVisibilityPersistenceSuite added in v0.22.0

type DBVisibilityPersistenceSuite struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
	VisibilityMgr p.VisibilityManager
}

DBVisibilityPersistenceSuite tests visibility persistence It only tests against DB based visibility, AdvancedVisibility test is in ESVisibilitySuite

func (*DBVisibilityPersistenceSuite) SetupSuite added in v0.22.0

func (s *DBVisibilityPersistenceSuite) SetupSuite()

SetupSuite implementation

func (*DBVisibilityPersistenceSuite) SetupTest added in v0.22.0

func (s *DBVisibilityPersistenceSuite) SetupTest()

SetupTest implementation

func (*DBVisibilityPersistenceSuite) TearDownSuite added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TearDownSuite()

TearDownSuite implementation

func (*DBVisibilityPersistenceSuite) TestBasicVisibility added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestBasicVisibility()

TestBasicVisibility test

func (*DBVisibilityPersistenceSuite) TestBasicVisibilityTimeSkew added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestBasicVisibilityTimeSkew()

TestBasicVisibilityTimeSkew test

func (*DBVisibilityPersistenceSuite) TestClosedWithoutStarted added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestClosedWithoutStarted()

TestClosedWithoutStarted test

func (*DBVisibilityPersistenceSuite) TestCronVisibility added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestCronVisibility()

TestCronVisibility test

func (*DBVisibilityPersistenceSuite) TestDelete added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestDelete()

TestDelete test

func (*DBVisibilityPersistenceSuite) TestFilteringByCloseStatus added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestFilteringByCloseStatus()

TestFilteringByCloseStatus test

func (*DBVisibilityPersistenceSuite) TestFilteringByType added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestFilteringByType()

TestFilteringByType test

func (*DBVisibilityPersistenceSuite) TestFilteringByWorkflowID added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestFilteringByWorkflowID()

TestFilteringByWorkflowID test

func (*DBVisibilityPersistenceSuite) TestGetClosedExecution added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestGetClosedExecution()

TestGetClosedExecution test

func (*DBVisibilityPersistenceSuite) TestMultipleUpserts added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestMultipleUpserts()

TestMultipleUpserts test

func (*DBVisibilityPersistenceSuite) TestUpsertWorkflowExecution added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestUpsertWorkflowExecution()

TestUpsertWorkflowExecution test

func (*DBVisibilityPersistenceSuite) TestVisibilityPagination added in v0.22.0

func (s *DBVisibilityPersistenceSuite) TestVisibilityPagination()

TestVisibilityPagination test

type ExecutionManagerSuite

type ExecutionManagerSuite struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
}

ExecutionManagerSuite contains matching persistence tests

func (*ExecutionManagerSuite) SetupSuite

func (s *ExecutionManagerSuite) SetupSuite()

SetupSuite implementation

func (*ExecutionManagerSuite) SetupTest

func (s *ExecutionManagerSuite) SetupTest()

SetupTest implementation

func (*ExecutionManagerSuite) TearDownSuite

func (s *ExecutionManagerSuite) TearDownSuite()

TearDownSuite implementation

func (*ExecutionManagerSuite) TestCancelTransferTaskTasks

func (s *ExecutionManagerSuite) TestCancelTransferTaskTasks()

TestCancelTransferTaskTasks test

func (*ExecutionManagerSuite) TestCleanupCorruptedWorkflow added in v0.11.0

func (s *ExecutionManagerSuite) TestCleanupCorruptedWorkflow()

TestCleanupCorruptedWorkflow test

func (*ExecutionManagerSuite) TestConflictResolveWorkflowExecutionCurrentIsSelf added in v0.7.0

func (s *ExecutionManagerSuite) TestConflictResolveWorkflowExecutionCurrentIsSelf()

TestConflictResolveWorkflowExecutionCurrentIsSelf test

func (*ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithCASMismatch added in v0.9.3

func (s *ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithCASMismatch()

TestConflictResolveWorkflowExecutionWithCASMismatch test

func (*ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionCurrentIsNotSelf added in v0.9.3

func (s *ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionCurrentIsNotSelf()

TestConflictResolveWorkflowExecutionWithTransactionCurrentIsNotSelf test

func (*ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionCurrentIsNotSelfWithContinueAsNew added in v0.9.3

func (s *ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionCurrentIsNotSelfWithContinueAsNew()

TestConflictResolveWorkflowExecutionWithTransactionCurrentIsNotSelfWithContinueAsNew test

func (*ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionCurrentIsSelf added in v0.9.3

func (s *ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionCurrentIsSelf()

TestConflictResolveWorkflowExecutionWithTransactionCurrentIsSelf test

func (*ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionCurrentIsSelfWithContinueAsNew added in v0.9.3

func (s *ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionCurrentIsSelfWithContinueAsNew()

TestConflictResolveWorkflowExecutionWithTransactionCurrentIsSelfWithContinueAsNew test

func (*ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionZombieIsSelf added in v0.9.3

func (s *ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionZombieIsSelf()

TestConflictResolveWorkflowExecutionWithTransactionZombieIsSelf test

func (*ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionZombieIsSelfWithContinueAsNew added in v0.9.3

func (s *ExecutionManagerSuite) TestConflictResolveWorkflowExecutionWithTransactionZombieIsSelfWithContinueAsNew()

TestConflictResolveWorkflowExecutionWithTransactionZombieIsSelfWithContinueAsNew test

func (*ExecutionManagerSuite) TestContinueAsNew

func (s *ExecutionManagerSuite) TestContinueAsNew()

TestContinueAsNew test

func (*ExecutionManagerSuite) TestCreateFailoverMarkerTasks added in v0.14.0

func (s *ExecutionManagerSuite) TestCreateFailoverMarkerTasks()

TestCreateFailoverMarkerTasks test

func (*ExecutionManagerSuite) TestCreateWorkflowExecutionBrandNew

func (s *ExecutionManagerSuite) TestCreateWorkflowExecutionBrandNew()

TestCreateWorkflowExecutionBrandNew test

func (*ExecutionManagerSuite) TestCreateWorkflowExecutionConcurrentCreate

func (s *ExecutionManagerSuite) TestCreateWorkflowExecutionConcurrentCreate()

TestCreateWorkflowExecutionConcurrentCreate test

func (*ExecutionManagerSuite) TestCreateWorkflowExecutionDeDup added in v0.11.0

func (s *ExecutionManagerSuite) TestCreateWorkflowExecutionDeDup()

TestCreateWorkflowExecutionDeDup test

func (*ExecutionManagerSuite) TestCreateWorkflowExecutionRunIDReuseWithoutReplication

func (s *ExecutionManagerSuite) TestCreateWorkflowExecutionRunIDReuseWithoutReplication()

TestCreateWorkflowExecutionRunIDReuseWithoutReplication test

func (*ExecutionManagerSuite) TestCreateWorkflowExecutionStateCloseStatus added in v0.5.9

func (s *ExecutionManagerSuite) TestCreateWorkflowExecutionStateCloseStatus()

TestCreateWorkflowExecutionStateCloseStatus test

func (*ExecutionManagerSuite) TestCreateWorkflowExecutionWithWorkflowRequestsDedup added in v1.2.9

func (s *ExecutionManagerSuite) TestCreateWorkflowExecutionWithWorkflowRequestsDedup()

func (*ExecutionManagerSuite) TestCreateWorkflowExecutionWithZombieState added in v0.9.3

func (s *ExecutionManagerSuite) TestCreateWorkflowExecutionWithZombieState()

TestCreateWorkflowExecutionWithZombieState test

func (*ExecutionManagerSuite) TestDeleteCurrentWorkflow

func (s *ExecutionManagerSuite) TestDeleteCurrentWorkflow()

TestDeleteCurrentWorkflow test

func (*ExecutionManagerSuite) TestDeleteWorkflow

func (s *ExecutionManagerSuite) TestDeleteWorkflow()

TestDeleteWorkflow test

func (*ExecutionManagerSuite) TestGetCurrentWorkflow

func (s *ExecutionManagerSuite) TestGetCurrentWorkflow()

TestGetCurrentWorkflow test

func (*ExecutionManagerSuite) TestGetWorkflow

func (s *ExecutionManagerSuite) TestGetWorkflow()

TestGetWorkflow test

func (*ExecutionManagerSuite) TestPersistenceStartWorkflow

func (s *ExecutionManagerSuite) TestPersistenceStartWorkflow()

TestPersistenceStartWorkflow test

func (*ExecutionManagerSuite) TestReplicationDLQ added in v0.12.0

func (s *ExecutionManagerSuite) TestReplicationDLQ()

TestReplicationDLQ test

func (*ExecutionManagerSuite) TestReplicationTasks

func (s *ExecutionManagerSuite) TestReplicationTasks()

TestReplicationTasks test

func (*ExecutionManagerSuite) TestReplicationTransferTaskRangeComplete added in v0.11.0

func (s *ExecutionManagerSuite) TestReplicationTransferTaskRangeComplete()

TestReplicationTransferTaskRangeComplete test

func (*ExecutionManagerSuite) TestReplicationTransferTaskTasks

func (s *ExecutionManagerSuite) TestReplicationTransferTaskTasks()

TestReplicationTransferTaskTasks test

func (*ExecutionManagerSuite) TestSignalTransferTaskTasks

func (s *ExecutionManagerSuite) TestSignalTransferTaskTasks()

TestSignalTransferTaskTasks test

func (*ExecutionManagerSuite) TestTimerTasksComplete

func (s *ExecutionManagerSuite) TestTimerTasksComplete()

TestTimerTasksComplete test

func (*ExecutionManagerSuite) TestTimerTasksRangeComplete

func (s *ExecutionManagerSuite) TestTimerTasksRangeComplete()

TestTimerTasksRangeComplete test

func (*ExecutionManagerSuite) TestTransferTasksComplete

func (s *ExecutionManagerSuite) TestTransferTasksComplete()

TestTransferTasksComplete test

func (*ExecutionManagerSuite) TestTransferTasksRangeComplete

func (s *ExecutionManagerSuite) TestTransferTasksRangeComplete()

TestTransferTasksRangeComplete test

func (*ExecutionManagerSuite) TestTransferTasksThroughUpdate

func (s *ExecutionManagerSuite) TestTransferTasksThroughUpdate()

TestTransferTasksThroughUpdate test

func (*ExecutionManagerSuite) TestUpdateAndClearBufferedEvents

func (s *ExecutionManagerSuite) TestUpdateAndClearBufferedEvents()

TestUpdateAndClearBufferedEvents test

func (*ExecutionManagerSuite) TestUpdateDeleteWorkflow added in v0.5.3

func (s *ExecutionManagerSuite) TestUpdateDeleteWorkflow()

TestUpdateDeleteWorkflow mocks the timer behavior to clean up workflow.

func (*ExecutionManagerSuite) TestUpdateWorkflow

func (s *ExecutionManagerSuite) TestUpdateWorkflow()

TestUpdateWorkflow test

func (*ExecutionManagerSuite) TestUpdateWorkflowExecutionStateCloseStatus added in v0.5.9

func (s *ExecutionManagerSuite) TestUpdateWorkflowExecutionStateCloseStatus()

TestUpdateWorkflowExecutionStateCloseStatus test

func (*ExecutionManagerSuite) TestUpdateWorkflowExecutionTasks added in v0.24.0

func (s *ExecutionManagerSuite) TestUpdateWorkflowExecutionTasks()

TestUpdateWorkflowExecutionTasks test

func (*ExecutionManagerSuite) TestUpdateWorkflowExecutionWithWorkflowRequestsDedup added in v1.2.9

func (s *ExecutionManagerSuite) TestUpdateWorkflowExecutionWithWorkflowRequestsDedup()

func (*ExecutionManagerSuite) TestUpdateWorkflowExecutionWithZombieState added in v0.9.3

func (s *ExecutionManagerSuite) TestUpdateWorkflowExecutionWithZombieState()

TestUpdateWorkflowExecutionWithZombieState test

func (*ExecutionManagerSuite) TestUpsertWorkflowActivity added in v0.14.2

func (s *ExecutionManagerSuite) TestUpsertWorkflowActivity()

TestUpsertWorkflowActivity test

func (*ExecutionManagerSuite) TestWorkflowMutableStateActivities

func (s *ExecutionManagerSuite) TestWorkflowMutableStateActivities()

TestWorkflowMutableStateActivities test

func (*ExecutionManagerSuite) TestWorkflowMutableStateChildExecutions

func (s *ExecutionManagerSuite) TestWorkflowMutableStateChildExecutions()

TestWorkflowMutableStateChildExecutions test

func (*ExecutionManagerSuite) TestWorkflowMutableStateInfo

func (s *ExecutionManagerSuite) TestWorkflowMutableStateInfo()

TestWorkflowMutableStateInfo test

func (*ExecutionManagerSuite) TestWorkflowMutableStateRequestCancel

func (s *ExecutionManagerSuite) TestWorkflowMutableStateRequestCancel()

TestWorkflowMutableStateRequestCancel test

func (*ExecutionManagerSuite) TestWorkflowMutableStateSignalInfo

func (s *ExecutionManagerSuite) TestWorkflowMutableStateSignalInfo()

TestWorkflowMutableStateSignalInfo test

func (*ExecutionManagerSuite) TestWorkflowMutableStateSignalRequested

func (s *ExecutionManagerSuite) TestWorkflowMutableStateSignalRequested()

TestWorkflowMutableStateSignalRequested test

func (*ExecutionManagerSuite) TestWorkflowMutableStateTimers

func (s *ExecutionManagerSuite) TestWorkflowMutableStateTimers()

TestWorkflowMutableStateTimers test

type ExecutionManagerSuiteForEventsV2 added in v0.5.0

type ExecutionManagerSuiteForEventsV2 struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
}

ExecutionManagerSuiteForEventsV2 contains matching persistence tests

func (*ExecutionManagerSuiteForEventsV2) SetupSuite added in v0.5.0

func (s *ExecutionManagerSuiteForEventsV2) SetupSuite()

SetupSuite implementation

func (*ExecutionManagerSuiteForEventsV2) SetupTest added in v0.5.0

func (s *ExecutionManagerSuiteForEventsV2) SetupTest()

SetupTest implementation

func (*ExecutionManagerSuiteForEventsV2) TearDownSuite added in v0.5.0

func (s *ExecutionManagerSuiteForEventsV2) TearDownSuite()

TearDownSuite implementation

func (*ExecutionManagerSuiteForEventsV2) TestContinueAsNew added in v0.5.0

func (s *ExecutionManagerSuiteForEventsV2) TestContinueAsNew()

TestContinueAsNew test

func (*ExecutionManagerSuiteForEventsV2) TestWorkflowCreation added in v0.5.0

func (s *ExecutionManagerSuiteForEventsV2) TestWorkflowCreation()

TestWorkflowCreation test

func (*ExecutionManagerSuiteForEventsV2) TestWorkflowCreationWithVersionHistories added in v0.9.3

func (s *ExecutionManagerSuiteForEventsV2) TestWorkflowCreationWithVersionHistories()

TestWorkflowCreationWithVersionHistories test

type HistoryV2PersistenceSuite added in v0.5.0

type HistoryV2PersistenceSuite struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
}

HistoryV2PersistenceSuite contains history persistence tests

func (*HistoryV2PersistenceSuite) SetupSuite added in v0.5.0

func (s *HistoryV2PersistenceSuite) SetupSuite()

SetupSuite implementation

func (*HistoryV2PersistenceSuite) SetupTest added in v0.5.0

func (s *HistoryV2PersistenceSuite) SetupTest()

SetupTest implementation

func (*HistoryV2PersistenceSuite) TearDownSuite added in v0.5.0

func (s *HistoryV2PersistenceSuite) TearDownSuite()

TearDownSuite implementation

func (*HistoryV2PersistenceSuite) TestConcurrentlyCreateAndAppendBranches added in v0.5.0

func (s *HistoryV2PersistenceSuite) TestConcurrentlyCreateAndAppendBranches()

TestConcurrentlyCreateAndAppendBranches test

func (*HistoryV2PersistenceSuite) TestConcurrentlyForkAndAppendBranches added in v0.5.0

func (s *HistoryV2PersistenceSuite) TestConcurrentlyForkAndAppendBranches()

TestConcurrentlyForkAndAppendBranches test

func (*HistoryV2PersistenceSuite) TestGenUUIDs added in v0.5.0

func (s *HistoryV2PersistenceSuite) TestGenUUIDs()

TestGenUUIDs testing uuid.New() can generate unique UUID

func (*HistoryV2PersistenceSuite) TestReadBranchByPagination added in v0.5.7

func (s *HistoryV2PersistenceSuite) TestReadBranchByPagination()

TestReadBranchByPagination test

func (*HistoryV2PersistenceSuite) TestScanAllTrees added in v0.9.0

func (s *HistoryV2PersistenceSuite) TestScanAllTrees()

TestScanAllTrees test

type MatchingPersistenceSuite

type MatchingPersistenceSuite struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
}

MatchingPersistenceSuite contains matching persistence tests

func (*MatchingPersistenceSuite) SetupSuite

func (s *MatchingPersistenceSuite) SetupSuite()

SetupSuite implementation

func (*MatchingPersistenceSuite) SetupTest

func (s *MatchingPersistenceSuite) SetupTest()

SetupTest implementation

func (*MatchingPersistenceSuite) TearDownSuite

func (s *MatchingPersistenceSuite) TearDownSuite()

TearDownSuite implementation

func (*MatchingPersistenceSuite) TestCompleteDecisionTask

func (s *MatchingPersistenceSuite) TestCompleteDecisionTask()

TestCompleteDecisionTask test

func (*MatchingPersistenceSuite) TestCompleteTasksLessThan added in v0.5.4

func (s *MatchingPersistenceSuite) TestCompleteTasksLessThan()

TestCompleteTasksLessThan test

func (*MatchingPersistenceSuite) TestCreateTask

func (s *MatchingPersistenceSuite) TestCreateTask()

TestCreateTask test

func (*MatchingPersistenceSuite) TestGetDecisionTasks

func (s *MatchingPersistenceSuite) TestGetDecisionTasks()

TestGetDecisionTasks test

func (*MatchingPersistenceSuite) TestGetOrphanTasks added in v0.21.0

func (s *MatchingPersistenceSuite) TestGetOrphanTasks()

func (*MatchingPersistenceSuite) TestGetTaskListSize added in v1.2.6

func (s *MatchingPersistenceSuite) TestGetTaskListSize()

func (*MatchingPersistenceSuite) TestGetTasksWithNoMaxReadLevel added in v0.5.7

func (s *MatchingPersistenceSuite) TestGetTasksWithNoMaxReadLevel()

TestGetTasksWithNoMaxReadLevel test

func (*MatchingPersistenceSuite) TestLeaseAndUpdateTaskList

func (s *MatchingPersistenceSuite) TestLeaseAndUpdateTaskList()

TestLeaseAndUpdateTaskList test

func (*MatchingPersistenceSuite) TestLeaseAndUpdateTaskListSticky

func (s *MatchingPersistenceSuite) TestLeaseAndUpdateTaskListSticky()

TestLeaseAndUpdateTaskListSticky test

func (*MatchingPersistenceSuite) TestListWithMultipleTaskList added in v0.5.4

func (s *MatchingPersistenceSuite) TestListWithMultipleTaskList()

TestListWithMultipleTaskList test

func (*MatchingPersistenceSuite) TestListWithOneTaskList added in v0.5.4

func (s *MatchingPersistenceSuite) TestListWithOneTaskList()

TestListWithOneTaskList test

type MetadataPersistenceSuiteV2

type MetadataPersistenceSuiteV2 struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
}

MetadataPersistenceSuiteV2 is test of the V2 version of metadata persistence

func (*MetadataPersistenceSuiteV2) CreateDomain

func (m *MetadataPersistenceSuiteV2) CreateDomain(
	ctx context.Context,
	info *p.DomainInfo,
	config *p.DomainConfig,
	replicationConfig *p.DomainReplicationConfig,
	isGlobaldomain bool,
	configVersion int64,
	failoverVersion int64,
	lastUpdateTime int64,
) (*p.CreateDomainResponse, error)

CreateDomain helper method

func (*MetadataPersistenceSuiteV2) DeleteDomain

func (m *MetadataPersistenceSuiteV2) DeleteDomain(ctx context.Context, id, name string) error

DeleteDomain helper method

func (*MetadataPersistenceSuiteV2) GetDomain

func (m *MetadataPersistenceSuiteV2) GetDomain(ctx context.Context, id, name string) (*p.GetDomainResponse, error)

GetDomain helper method

func (*MetadataPersistenceSuiteV2) ListDomains

func (m *MetadataPersistenceSuiteV2) ListDomains(ctx context.Context, pageSize int, pageToken []byte) (*p.ListDomainsResponse, error)

ListDomains helper method

func (*MetadataPersistenceSuiteV2) SetupSuite

func (m *MetadataPersistenceSuiteV2) SetupSuite()

SetupSuite implementation

func (*MetadataPersistenceSuiteV2) SetupTest

func (m *MetadataPersistenceSuiteV2) SetupTest()

SetupTest implementation

func (*MetadataPersistenceSuiteV2) TearDownSuite

func (m *MetadataPersistenceSuiteV2) TearDownSuite()

TearDownSuite implementation

func (*MetadataPersistenceSuiteV2) TearDownTest

func (m *MetadataPersistenceSuiteV2) TearDownTest()

TearDownTest implementation

func (*MetadataPersistenceSuiteV2) TestConcurrentCreateDomain

func (m *MetadataPersistenceSuiteV2) TestConcurrentCreateDomain()

TestConcurrentCreateDomain test

func (*MetadataPersistenceSuiteV2) TestConcurrentUpdateDomain

func (m *MetadataPersistenceSuiteV2) TestConcurrentUpdateDomain()

TestConcurrentUpdateDomain test

func (*MetadataPersistenceSuiteV2) TestCreateDomain

func (m *MetadataPersistenceSuiteV2) TestCreateDomain()

TestCreateDomain test

func (*MetadataPersistenceSuiteV2) TestDeleteDomain

func (m *MetadataPersistenceSuiteV2) TestDeleteDomain()

TestDeleteDomain test

func (*MetadataPersistenceSuiteV2) TestGetDomain

func (m *MetadataPersistenceSuiteV2) TestGetDomain()

TestGetDomain test

func (*MetadataPersistenceSuiteV2) TestListDomains

func (m *MetadataPersistenceSuiteV2) TestListDomains()

TestListDomains test

func (*MetadataPersistenceSuiteV2) TestUpdateDomain

func (m *MetadataPersistenceSuiteV2) TestUpdateDomain()

TestUpdateDomain test

func (*MetadataPersistenceSuiteV2) UpdateDomain

func (m *MetadataPersistenceSuiteV2) UpdateDomain(
	ctx context.Context,
	info *p.DomainInfo,
	config *p.DomainConfig,
	replicationConfig *p.DomainReplicationConfig,
	configVersion int64,
	failoverVersion int64,
	failoverNotificationVersion int64,
	PreviousFailoverVersion int64,
	failoverEndTime *int64,
	notificationVersion int64,
	lastUpdateTime int64,
) error

UpdateDomain helper method

type QueuePersistenceSuite added in v0.9.3

type QueuePersistenceSuite struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
}

QueuePersistenceSuite contains queue persistence tests

func (*QueuePersistenceSuite) SetupSuite added in v0.9.3

func (s *QueuePersistenceSuite) SetupSuite()

SetupSuite implementation

func (*QueuePersistenceSuite) SetupTest added in v0.9.3

func (s *QueuePersistenceSuite) SetupTest()

SetupTest implementation

func (*QueuePersistenceSuite) TearDownSuite added in v0.9.3

func (s *QueuePersistenceSuite) TearDownSuite()

TearDownSuite implementation

func (*QueuePersistenceSuite) TestDomainDLQMetadataOperations added in v0.12.0

func (s *QueuePersistenceSuite) TestDomainDLQMetadataOperations()

TestDomainDLQMetadataOperations tests queue metadata operations

func (*QueuePersistenceSuite) TestDomainReplicationDLQ added in v0.12.0

func (s *QueuePersistenceSuite) TestDomainReplicationDLQ()

TestDomainReplicationDLQ tests domain DLQ operations

func (*QueuePersistenceSuite) TestDomainReplicationQueue added in v0.9.3

func (s *QueuePersistenceSuite) TestDomainReplicationQueue()

TestDomainReplicationQueue tests domain replication queue operations

func (*QueuePersistenceSuite) TestQueueMetadataOperations added in v0.10.0

func (s *QueuePersistenceSuite) TestQueueMetadataOperations()

TestQueueMetadataOperations tests queue metadata operations

type ShardPersistenceSuite

type ShardPersistenceSuite struct {
	*TestBase
	// override suite.Suite.Assertions with require.Assertions; this means that s.NotNil(nil) will stop the test,
	// not merely log an error
	*require.Assertions
}

ShardPersistenceSuite contains shard persistence tests

func (*ShardPersistenceSuite) SetupSuite

func (s *ShardPersistenceSuite) SetupSuite()

SetupSuite implementation

func (*ShardPersistenceSuite) SetupTest

func (s *ShardPersistenceSuite) SetupTest()

SetupTest implementation

func (*ShardPersistenceSuite) TearDownSuite

func (s *ShardPersistenceSuite) TearDownSuite()

TearDownSuite implementation

func (*ShardPersistenceSuite) TestCreateGetShardBackfill added in v0.22.0

func (s *ShardPersistenceSuite) TestCreateGetShardBackfill()

func (*ShardPersistenceSuite) TestCreateGetUpdateGetShard added in v0.22.0

func (s *ShardPersistenceSuite) TestCreateGetUpdateGetShard()

func (*ShardPersistenceSuite) TestCreateShard

func (s *ShardPersistenceSuite) TestCreateShard()

TestCreateShard test

func (*ShardPersistenceSuite) TestGetShard

func (s *ShardPersistenceSuite) TestGetShard()

TestGetShard test

func (*ShardPersistenceSuite) TestUpdateShard

func (s *ShardPersistenceSuite) TestUpdateShard()

TestUpdateShard test

type TestBase

type TestBase struct {
	*suite.Suite
	ShardMgr                  persistence.ShardManager
	ExecutionMgrFactory       client.Factory
	ExecutionManager          persistence.ExecutionManager
	TaskMgr                   persistence.TaskManager
	HistoryV2Mgr              persistence.HistoryManager
	DomainManager             persistence.DomainManager
	DomainReplicationQueueMgr persistence.QueueManager
	ShardInfo                 *persistence.ShardInfo
	TaskIDGenerator           TransferTaskIDGenerator
	ClusterMetadata           cluster.Metadata
	DefaultTestCluster        testcluster.PersistenceTestCluster
	VisibilityTestCluster     testcluster.PersistenceTestCluster
	Logger                    log.Logger
	PayloadSerializer         persistence.PayloadSerializer
	ConfigStoreManager        persistence.ConfigStoreManager
	DynamicConfiguration      persistence.DynamicConfiguration
}

TestBase wraps the base setup needed to create workflows over persistence layer.

func NewTestBaseFromParams added in v0.20.0

func NewTestBaseFromParams(t *testing.T, params TestBaseParams) *TestBase

NewTestBaseFromParams returns a customized test base from given input

func NewTestBaseWithNoSQL added in v0.23.1

func NewTestBaseWithNoSQL(t *testing.T, options *TestBaseOptions) *TestBase

NewTestBaseWithNoSQL returns a persistence test base backed by nosql datastore

func NewTestBaseWithSQL

func NewTestBaseWithSQL(t *testing.T, options *TestBaseOptions) *TestBase

NewTestBaseWithSQL returns a new persistence test base backed by SQL

func (*TestBase) ClearReplicationQueue

func (s *TestBase) ClearReplicationQueue()

ClearReplicationQueue completes all tasks in replication queue

func (*TestBase) ClearTasks

func (s *TestBase) ClearTasks()

ClearTasks completes all transfer tasks and replication tasks

func (*TestBase) ClearTransferQueue

func (s *TestBase) ClearTransferQueue()

ClearTransferQueue completes all tasks in transfer queue

func (*TestBase) CompleteCrossClusterTask added in v0.22.0

func (s *TestBase) CompleteCrossClusterTask(ctx context.Context, targetCluster string, taskID int64) error

CompleteCrossClusterTask is a utility method to complete a cross-cluster task

func (*TestBase) CompleteReplicationTask

func (s *TestBase) CompleteReplicationTask(ctx context.Context, taskID int64) error

CompleteReplicationTask is a utility method to complete a replication task

func (*TestBase) CompleteTask

func (s *TestBase) CompleteTask(ctx context.Context, domainID, taskList string, taskType int, taskID int64, ackLevel int64) error

CompleteTask is a utility method to complete a task

func (*TestBase) CompleteTimerTask

func (s *TestBase) CompleteTimerTask(ctx context.Context, ts time.Time, taskID int64) error

CompleteTimerTask is a utility method to complete a timer task

func (*TestBase) CompleteTransferTask

func (s *TestBase) CompleteTransferTask(ctx context.Context, taskID int64) error

CompleteTransferTask is a utility method to complete a transfer task

func (*TestBase) Config added in v0.5.7

func (s *TestBase) Config() config.Persistence

Config returns the persistence configuration for this test

func (*TestBase) ConflictResolveWorkflowExecution added in v0.7.0

func (s *TestBase) ConflictResolveWorkflowExecution(
	ctx context.Context,
	info *persistence.WorkflowExecutionInfo,
	stats *persistence.ExecutionStats,
	nextEventID int64,
	activityInfos []*persistence.ActivityInfo,
	timerInfos []*persistence.TimerInfo,
	childExecutionInfos []*persistence.ChildExecutionInfo,
	requestCancelInfos []*persistence.RequestCancelInfo,
	signalInfos []*persistence.SignalInfo,
	ids []string,
	versionHistories *persistence.VersionHistories,
) error

ConflictResolveWorkflowExecution is utility method to reset mutable state

func (*TestBase) ContinueAsNewExecution

func (s *TestBase) ContinueAsNewExecution(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	condition int64,
	newExecution types.WorkflowExecution,
	nextEventID, decisionScheduleID int64,
	prevResetPoints *types.ResetPoints,
) error

ContinueAsNewExecution is a utility method to create workflow executions

func (*TestBase) CreateActivityTasks

func (s *TestBase) CreateActivityTasks(ctx context.Context, domainID string, workflowExecution types.WorkflowExecution,
	activities map[int64]string, partitionConfig map[string]string) ([]int64, error)

CreateActivityTasks is a utility method to create tasks

func (*TestBase) CreateChildWorkflowExecution

func (s *TestBase) CreateChildWorkflowExecution(ctx context.Context, domainID string, workflowExecution types.WorkflowExecution,
	parentDomainID string, parentExecution types.WorkflowExecution, initiatedID int64, taskList, wType string,
	wTimeout int32, decisionTimeout int32, executionContext []byte, nextEventID int64, lastProcessedEventID int64,
	decisionScheduleID int64, timerTasks []persistence.Task, partitionConfig map[string]string) (*persistence.CreateWorkflowExecutionResponse, error)

CreateChildWorkflowExecution is a utility method to create child workflow executions

func (*TestBase) CreateDecisionTask

func (s *TestBase) CreateDecisionTask(ctx context.Context, domainID string, workflowExecution types.WorkflowExecution, taskList string,
	decisionScheduleID int64, partitionConfig map[string]string) (int64, error)

CreateDecisionTask is a utility method to create a task

func (*TestBase) CreateFailoverMarkers added in v0.14.0

func (s *TestBase) CreateFailoverMarkers(
	ctx context.Context,
	markers []*persistence.FailoverMarkerTask,
) error

CreateFailoverMarkers is a utility method to create failover markers

func (*TestBase) CreateShard

func (s *TestBase) CreateShard(ctx context.Context, shardID int, owner string, rangeID int64) error

CreateShard is a utility method to create the shard using persistence layer

func (*TestBase) CreateWorkflowExecution

func (s *TestBase) CreateWorkflowExecution(
	ctx context.Context,
	domainID string,
	workflowExecution types.WorkflowExecution,
	taskList string,
	wType string,
	wTimeout int32,
	decisionTimeout int32,
	executionContext []byte,
	nextEventID int64,
	lastProcessedEventID int64,
	decisionScheduleID int64,
	timerTasks []persistence.Task,
	partitionConfig map[string]string,
) (*persistence.CreateWorkflowExecutionResponse, error)

CreateWorkflowExecution is a utility method to create workflow executions

func (*TestBase) CreateWorkflowExecutionWithBranchToken added in v0.10.0

func (s *TestBase) CreateWorkflowExecutionWithBranchToken(
	ctx context.Context,
	domainID string,
	workflowExecution types.WorkflowExecution,
	taskList string,
	wType string,
	wTimeout int32,
	decisionTimeout int32,
	executionContext []byte,
	nextEventID int64,
	lastProcessedEventID int64,
	decisionScheduleID int64,
	branchToken []byte,
	timerTasks []persistence.Task,
	partitionConfig map[string]string,
) (*persistence.CreateWorkflowExecutionResponse, error)

CreateWorkflowExecutionWithBranchToken test util function

func (*TestBase) DeleteCancelState

func (s *TestBase) DeleteCancelState(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	deleteCancelInfo int64,
) error

DeleteCancelState is a utility method to delete request cancel state from mutable state

func (*TestBase) DeleteChildExecutionsState

func (s *TestBase) DeleteChildExecutionsState(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	deleteChildInfo int64,
) error

DeleteChildExecutionsState is a utility method to delete child execution from mutable state

func (*TestBase) DeleteCurrentWorkflowExecution added in v0.5.8

func (s *TestBase) DeleteCurrentWorkflowExecution(ctx context.Context, info *persistence.WorkflowExecutionInfo) error

DeleteCurrentWorkflowExecution is a utility method to delete the workflow current execution

func (*TestBase) DeleteMessageFromDomainDLQ added in v0.12.0

func (s *TestBase) DeleteMessageFromDomainDLQ(
	ctx context.Context,
	messageID int64,
) error

DeleteMessageFromDomainDLQ deletes one message from domain DLQ

func (*TestBase) DeleteReplicationTaskFromDLQ added in v0.12.0

func (s *TestBase) DeleteReplicationTaskFromDLQ(
	ctx context.Context,
	sourceCluster string,
	taskID int64,
) error

DeleteReplicationTaskFromDLQ is a utility method to delete a replication task info

func (*TestBase) DeleteSignalState

func (s *TestBase) DeleteSignalState(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	deleteSignalInfo int64,
) error

DeleteSignalState is a utility method to delete request cancel state from mutable state

func (*TestBase) DeleteSignalsRequestedState

func (s *TestBase) DeleteSignalsRequestedState(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	deleteSignalsRequestedIDs []string,
) error

DeleteSignalsRequestedState is a utility method to delete mutable state of workflow execution

func (*TestBase) DeleteWorkflowExecution

func (s *TestBase) DeleteWorkflowExecution(ctx context.Context, info *persistence.WorkflowExecutionInfo) error

DeleteWorkflowExecution is a utility method to delete a workflow execution

func (*TestBase) EqualTimes

func (s *TestBase) EqualTimes(t1, t2 time.Time)

EqualTimes assertion that two times are equal within two millisecond precision

func (*TestBase) EqualTimesWithPrecision

func (s *TestBase) EqualTimesWithPrecision(t1, t2 time.Time, precision time.Duration)

EqualTimesWithPrecision assertion that two times are equal within precision

func (*TestBase) GetAckLevels added in v0.10.0

func (s *TestBase) GetAckLevels(
	ctx context.Context,
) (map[string]int64, error)

GetAckLevels returns replication queue ack levels

func (*TestBase) GetCrossClusterTasks added in v0.22.0

func (s *TestBase) GetCrossClusterTasks(ctx context.Context, targetCluster string, readLevel int64, batchSize int, getAll bool) ([]*persistence.CrossClusterTaskInfo, error)

GetCrossClusterTasks is a utility method to get tasks from transfer task queue

func (*TestBase) GetCurrentWorkflowRunID

func (s *TestBase) GetCurrentWorkflowRunID(ctx context.Context, domainID, workflowID string) (string, error)

GetCurrentWorkflowRunID returns the workflow run ID for the given params

func (*TestBase) GetDecisionTaskListSize added in v1.2.6

func (s *TestBase) GetDecisionTaskListSize(ctx context.Context, domainID, taskList string, ackLevel int64) (int64, error)

func (*TestBase) GetDomainDLQAckLevel added in v0.12.0

func (s *TestBase) GetDomainDLQAckLevel(
	ctx context.Context,
) (map[string]int64, error)

GetDomainDLQAckLevel returns domain dlq ack level

func (*TestBase) GetDomainDLQSize added in v0.17.0

func (s *TestBase) GetDomainDLQSize(
	ctx context.Context,
) (int64, error)

GetDomainDLQSize returns domain dlq size

func (*TestBase) GetMessagesFromDomainDLQ added in v0.12.0

func (s *TestBase) GetMessagesFromDomainDLQ(
	ctx context.Context,
	firstMessageID int64,
	lastMessageID int64,
	pageSize int,
	pageToken []byte,
) ([]*persistence.QueueMessage, []byte, error)

GetMessagesFromDomainDLQ is a utility method to get messages from the domain DLQ

func (*TestBase) GetNextSequenceNumber

func (s *TestBase) GetNextSequenceNumber() int64

GetNextSequenceNumber generates a unique sequence number for can be used for transfer queue taskId

func (*TestBase) GetReplicationDLQSize added in v0.14.0

func (s *TestBase) GetReplicationDLQSize(
	ctx context.Context,
	sourceCluster string,
) (*persistence.GetReplicationDLQSizeResponse, error)

GetReplicationDLQSize is a utility method to read replication dlq size

func (*TestBase) GetReplicationMessages added in v0.9.3

func (s *TestBase) GetReplicationMessages(
	ctx context.Context,
	lastMessageID int64,
	maxCount int,
) ([]*persistence.QueueMessage, error)

GetReplicationMessages is a utility method to get messages from the queue

func (*TestBase) GetReplicationTasks

func (s *TestBase) GetReplicationTasks(ctx context.Context, batchSize int, getAll bool) ([]*persistence.ReplicationTaskInfo, error)

GetReplicationTasks is a utility method to get tasks from replication task queue

func (*TestBase) GetReplicationTasksFromDLQ added in v0.12.0

func (s *TestBase) GetReplicationTasksFromDLQ(
	ctx context.Context,
	sourceCluster string,
	readLevel int64,
	maxReadLevel int64,
	pageSize int,
	pageToken []byte,
) (*persistence.GetReplicationTasksFromDLQResponse, error)

GetReplicationTasksFromDLQ is a utility method to read replication task info

func (*TestBase) GetShard

func (s *TestBase) GetShard(ctx context.Context, shardID int) (*persistence.ShardInfo, error)

GetShard is a utility method to get the shard using persistence layer

func (*TestBase) GetTasks

func (s *TestBase) GetTasks(ctx context.Context, domainID, taskList string, taskType int, batchSize int) (*persistence.GetTasksResponse, error)

GetTasks is a utility method to get tasks from persistence

func (*TestBase) GetTimerIndexTasks

func (s *TestBase) GetTimerIndexTasks(ctx context.Context, batchSize int, getAll bool) ([]*persistence.TimerTaskInfo, error)

GetTimerIndexTasks is a utility method to get tasks from transfer task queue

func (*TestBase) GetTransferTasks

func (s *TestBase) GetTransferTasks(ctx context.Context, batchSize int, getAll bool) ([]*persistence.TransferTaskInfo, error)

GetTransferTasks is a utility method to get tasks from transfer task queue

func (*TestBase) GetWorkflowExecutionInfo

func (s *TestBase) GetWorkflowExecutionInfo(ctx context.Context, domainID string, workflowExecution types.WorkflowExecution) (
	*persistence.WorkflowMutableState, error)

GetWorkflowExecutionInfo is a utility method to retrieve execution info

func (*TestBase) GetWorkflowExecutionInfoWithStats

func (s *TestBase) GetWorkflowExecutionInfoWithStats(ctx context.Context, domainID string, workflowExecution types.WorkflowExecution) (
	*persistence.MutableStateStats, *persistence.WorkflowMutableState, error)

GetWorkflowExecutionInfoWithStats is a utility method to retrieve execution info with size stats

func (*TestBase) Publish added in v0.9.3

func (s *TestBase) Publish(
	ctx context.Context,
	messagePayload []byte,
) error

Publish is a utility method to add messages to the queue

func (*TestBase) PublishToDomainDLQ added in v0.12.0

func (s *TestBase) PublishToDomainDLQ(
	ctx context.Context,
	messagePayload []byte,
) error

PublishToDomainDLQ is a utility method to add messages to the domain DLQ

func (*TestBase) PutReplicationTaskToDLQ added in v0.12.0

func (s *TestBase) PutReplicationTaskToDLQ(
	ctx context.Context,
	sourceCluster string,
	taskInfo *persistence.ReplicationTaskInfo,
) error

PutReplicationTaskToDLQ is a utility method to insert a replication task info

func (*TestBase) RangeCompleteCrossClusterTask added in v0.22.0

func (s *TestBase) RangeCompleteCrossClusterTask(ctx context.Context, targetCluster string, exclusiveBeginTaskID int64, inclusiveEndTaskID int64) error

RangeCompleteCrossClusterTask is a utility method to complete a range of cross-cluster tasks

func (*TestBase) RangeCompleteReplicationTask added in v0.11.0

func (s *TestBase) RangeCompleteReplicationTask(ctx context.Context, inclusiveEndTaskID int64) error

RangeCompleteReplicationTask is a utility method to complete a range of replication tasks

func (*TestBase) RangeCompleteTimerTask

func (s *TestBase) RangeCompleteTimerTask(ctx context.Context, inclusiveBeginTimestamp time.Time, exclusiveEndTimestamp time.Time) error

RangeCompleteTimerTask is a utility method to complete a range of timer tasks

func (*TestBase) RangeCompleteTransferTask

func (s *TestBase) RangeCompleteTransferTask(ctx context.Context, exclusiveBeginTaskID int64, inclusiveEndTaskID int64) error

RangeCompleteTransferTask is a utility method to complete a range of transfer tasks

func (*TestBase) RangeDeleteMessagesFromDomainDLQ added in v0.12.0

func (s *TestBase) RangeDeleteMessagesFromDomainDLQ(
	ctx context.Context,
	firstMessageID int64,
	lastMessageID int64,
) error

RangeDeleteMessagesFromDomainDLQ deletes messages from domain DLQ

func (*TestBase) RangeDeleteReplicationTaskFromDLQ added in v0.12.0

func (s *TestBase) RangeDeleteReplicationTaskFromDLQ(
	ctx context.Context,
	sourceCluster string,
	beginTaskID int64,
	endTaskID int64,
) error

RangeDeleteReplicationTaskFromDLQ is a utility method to delete replication task info

func (*TestBase) Setup

func (s *TestBase) Setup()

Setup sets up the test base, must be called as part of SetupSuite

func (*TestBase) TearDownWorkflowStore

func (s *TestBase) TearDownWorkflowStore()

TearDownWorkflowStore to cleanup

func (*TestBase) UpdateAckLevel added in v0.10.0

func (s *TestBase) UpdateAckLevel(
	ctx context.Context,
	lastProcessedMessageID int64,
	clusterName string,
) error

UpdateAckLevel updates replication queue ack level

func (*TestBase) UpdateAllMutableState

func (s *TestBase) UpdateAllMutableState(ctx context.Context, updatedMutableState *persistence.WorkflowMutableState, condition int64) error

UpdateAllMutableState is a utility method to update workflow execution

func (*TestBase) UpdateDomainDLQAckLevel added in v0.12.0

func (s *TestBase) UpdateDomainDLQAckLevel(
	ctx context.Context,
	lastProcessedMessageID int64,
	clusterName string,
) error

UpdateDomainDLQAckLevel updates domain dlq ack level

func (*TestBase) UpdateShard

func (s *TestBase) UpdateShard(ctx context.Context, updatedInfo *persistence.ShardInfo, previousRangeID int64) error

UpdateShard is a utility method to update the shard using persistence layer

func (*TestBase) UpdateWorkflowExecution

func (s *TestBase) UpdateWorkflowExecution(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	decisionScheduleIDs []int64,
	activityScheduleIDs []int64,
	condition int64,
	timerTasks []persistence.Task,
	upsertActivityInfos []*persistence.ActivityInfo,
	deleteActivityInfos []int64,
	upsertTimerInfos []*persistence.TimerInfo,
	deleteTimerInfos []string,
) error

UpdateWorkflowExecution is a utility method to update workflow execution

func (*TestBase) UpdateWorkflowExecutionAndFinish

func (s *TestBase) UpdateWorkflowExecutionAndFinish(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	condition int64,
	versionHistories *persistence.VersionHistories,
) error

UpdateWorkflowExecutionAndFinish is a utility method to update workflow execution

func (*TestBase) UpdateWorkflowExecutionForBufferEvents

func (s *TestBase) UpdateWorkflowExecutionForBufferEvents(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	condition int64,
	bufferEvents []*types.HistoryEvent,
	clearBufferedEvents bool,
	versionHistories *persistence.VersionHistories,
) error

UpdateWorkflowExecutionForBufferEvents is a utility method to update workflow execution

func (*TestBase) UpdateWorkflowExecutionForChildExecutionsInitiated

func (s *TestBase) UpdateWorkflowExecutionForChildExecutionsInitiated(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo, updatedStats *persistence.ExecutionStats, condition int64, transferTasks []persistence.Task, childInfos []*persistence.ChildExecutionInfo) error

UpdateWorkflowExecutionForChildExecutionsInitiated is a utility method to update workflow execution

func (*TestBase) UpdateWorkflowExecutionForRequestCancel

func (s *TestBase) UpdateWorkflowExecutionForRequestCancel(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo, updatedStats *persistence.ExecutionStats, condition int64, transferTasks []persistence.Task,
	upsertRequestCancelInfo []*persistence.RequestCancelInfo) error

UpdateWorkflowExecutionForRequestCancel is a utility method to update workflow execution

func (*TestBase) UpdateWorkflowExecutionForSignal

func (s *TestBase) UpdateWorkflowExecutionForSignal(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo, updatedStats *persistence.ExecutionStats, condition int64, transferTasks []persistence.Task,
	upsertSignalInfos []*persistence.SignalInfo) error

UpdateWorkflowExecutionForSignal is a utility method to update workflow execution

func (*TestBase) UpdateWorkflowExecutionTasks added in v0.24.0

func (s *TestBase) UpdateWorkflowExecutionTasks(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	condition int64,
	transferTasks []persistence.Task,
	timerTasks []persistence.Task,
	crossClusterTasks []persistence.Task,
) error

UpdateWorkflowExecutionTasks is a utility method to update workflow tasks with IgnoreCurrent update mode.

func (*TestBase) UpdateWorkflowExecutionWithRangeID

func (s *TestBase) UpdateWorkflowExecutionWithRangeID(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	decisionScheduleIDs []int64,
	activityScheduleIDs []int64,
	rangeID int64,
	condition int64,
	timerTasks []persistence.Task,
	upsertActivityInfos []*persistence.ActivityInfo,
	deleteActivityInfos []int64,
	upsertTimerInfos []*persistence.TimerInfo,
	deleteTimerInfos []string,
	upsertChildInfos []*persistence.ChildExecutionInfo,
	deleteChildInfos []int64,
	upsertCancelInfos []*persistence.RequestCancelInfo,
	deleteCancelInfos []int64,
	upsertSignalInfos []*persistence.SignalInfo,
	deleteSignalInfos []int64,
	upsertSignalRequestedIDs []string,
	deleteSignalRequestedIDs []string,
) error

UpdateWorkflowExecutionWithRangeID is a utility method to update workflow execution

func (*TestBase) UpdateWorkflowExecutionWithReplication

func (s *TestBase) UpdateWorkflowExecutionWithReplication(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	decisionScheduleIDs []int64,
	activityScheduleIDs []int64,
	rangeID int64,
	condition int64,
	timerTasks []persistence.Task,
	txTasks []persistence.Task,
	upsertActivityInfos []*persistence.ActivityInfo,
	deleteActivityInfos []int64,
	upsertTimerInfos []*persistence.TimerInfo,
	deleteTimerInfos []string,
	upsertChildInfos []*persistence.ChildExecutionInfo,
	deleteChildInfos []int64,
	upsertCancelInfos []*persistence.RequestCancelInfo,
	deleteCancelInfos []int64,
	upsertSignalInfos []*persistence.SignalInfo,
	deleteSignalInfos []int64,
	upsertSignalRequestedIDs []string,
	deleteSignalRequestedIDs []string,
) error

UpdateWorkflowExecutionWithReplication is a utility method to update workflow execution

func (*TestBase) UpdateWorkflowExecutionWithTransferTasks

func (s *TestBase) UpdateWorkflowExecutionWithTransferTasks(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	condition int64,
	transferTasks []persistence.Task,
	upsertActivityInfo []*persistence.ActivityInfo,
	versionHistories *persistence.VersionHistories,
) error

UpdateWorkflowExecutionWithTransferTasks is a utility method to update workflow execution

func (*TestBase) UpdateWorklowStateAndReplication

func (s *TestBase) UpdateWorklowStateAndReplication(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	txTasks []persistence.Task,
) error

UpdateWorklowStateAndReplication is a utility method to update workflow execution

func (*TestBase) UpsertChildExecutionsState

func (s *TestBase) UpsertChildExecutionsState(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	upsertChildInfos []*persistence.ChildExecutionInfo,
) error

UpsertChildExecutionsState is a utility method to update mutable state of workflow execution

func (*TestBase) UpsertRequestCancelState

func (s *TestBase) UpsertRequestCancelState(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	upsertCancelInfos []*persistence.RequestCancelInfo,
) error

UpsertRequestCancelState is a utility method to update mutable state of workflow execution

func (*TestBase) UpsertSignalInfoState

func (s *TestBase) UpsertSignalInfoState(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	upsertSignalInfos []*persistence.SignalInfo,
) error

UpsertSignalInfoState is a utility method to update mutable state of workflow execution

func (*TestBase) UpsertSignalsRequestedState

func (s *TestBase) UpsertSignalsRequestedState(
	ctx context.Context,
	updatedInfo *persistence.WorkflowExecutionInfo,
	updatedStats *persistence.ExecutionStats,
	updatedVersionHistories *persistence.VersionHistories,
	condition int64,
	upsertSignalsRequested []string,
) error

UpsertSignalsRequestedState is a utility method to update mutable state of workflow execution

type TestBaseOptions

type TestBaseOptions struct {
	DBPluginName    string
	DBName          string
	DBUsername      string
	DBPassword      string
	DBHost          string
	DBPort          int              `yaml:"-"`
	StoreType       string           `yaml:"-"`
	SchemaDir       string           `yaml:"-"`
	ClusterMetadata cluster.Metadata `yaml:"-"`
	ProtoVersion    int              `yaml:"-"`
	Replicas        int              `yaml:"-"`
	MaxConns        int              `yaml:"-"`
}

TestBaseOptions options to configure workflow test base.

type TestBaseParams added in v0.20.0

type TestBaseParams struct {
	DefaultTestCluster    testcluster.PersistenceTestCluster
	VisibilityTestCluster testcluster.PersistenceTestCluster
	ClusterMetadata       cluster.Metadata
	DynamicConfiguration  persistence.DynamicConfiguration
}

TestBaseParams defines the input of TestBase

type TestTransferTaskIDGenerator

type TestTransferTaskIDGenerator struct {
	// contains filtered or unexported fields
}

TestTransferTaskIDGenerator helper

func (*TestTransferTaskIDGenerator) GenerateTransferTaskID added in v0.7.0

func (g *TestTransferTaskIDGenerator) GenerateTransferTaskID() (int64, error)

GenerateTransferTaskID helper

func (*TestTransferTaskIDGenerator) GenerateTransferTaskIDs added in v0.7.0

func (g *TestTransferTaskIDGenerator) GenerateTransferTaskIDs(number int) ([]int64, error)

GenerateTransferTaskIDs helper

type TransferTaskIDGenerator

type TransferTaskIDGenerator interface {
	GenerateTransferTaskID() (int64, error)
}

TransferTaskIDGenerator generates IDs for transfer tasks written by helper methods

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL