Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( MatchingDisableSyncMatch = newKey[bool, namespace.ID]() MatchingLBForceReadPartition = newKey[int, namespace.ID]() MatchingLBForceWritePartition = newKey[int, namespace.ID]() UpdateWithStartInBetweenLockAndStart = newKey[func(), namespace.ID]() UpdateWithStartOnClosingWorkflowRetry = newKey[func(), namespace.ID]() TaskQueuesInDeploymentSyncBatchSize = newKey[int, global]() MatchingIgnoreRoutingConfigRevisionCheck = newKey[bool, namespace.ID]() MatchingDeploymentRegisterErrorBackoff = newKey[time.Duration, namespace.ID]() MatchingForwardTaskDelay = newKey[time.Duration, namespace.ID]() HistoryReplicationTaskInterceptor = newKey[func(*replicationspb.ReplicationTask, func() error) error, global]() HistoryReplicationDLQWriteInterceptor = newKey[func(*persistencespb.ReplicationTaskInfo, func() error) error, global]() HistoryChasmRuntimeProvider = newKey[func(chasm.Engine, chasm.VisibilityManager, *chasm.Registry), global]() HistoryTransferTaskInterceptor = newKey[func(historytasks.Task, func()), namespace.ID]() HistoryDLQTaskDeleteInterceptor = newKey[func(context.Context, *historyservice.DeleteDLQTasksRequest, func(context.Context, *historyservice.DeleteDLQTasksRequest) (*historyservice.DeleteDLQTasksResponse, error)) (*historyservice.DeleteDLQTasksResponse, error), global]() NamespaceReplicationTaskInterceptor = newKey[func(context.Context, *replicationspb.NamespaceTaskAttributes, func() error) error, namespace.Name]() )
Test hook keys with their return type and scope. Try to avoid global scope as it requires a dedicated test cluster.
var GlobalScope = global{}
GlobalScope is the singleton value for global hooks.
var Module = fx.Options( fx.Provide(NewTestHooks), )
Functions ¶
func Call ¶
Call calls a func() hook if present.
TestHooks should be used very sparingly, see comment on TestHooks.
Types ¶
type Hook ¶ added in v1.31.0
type Hook struct{}
Hook is an empty stub in production mode. NewHook and its methods are only available with -tags=test_dep.
type ScopeType ¶ added in v1.31.0
type ScopeType int
ScopeType indicates the scope of a hook at runtime.
type TestHooks ¶
type TestHooks struct{}
TestHooks (in production mode) is an empty struct just so the build works. See TestHooks in test_impl.go.
TestHooks are an inherently unclean way of writing tests. They require mixing test-only concerns into production code. In general you should prefer other ways of writing tests wherever possible, and only use TestHooks sparingly, as a last resort.
func NewTestHooks ¶ added in v1.30.0
func NewTestHooks() TestHooks