types

package
v1.3.6-prerelease02 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultTestCase = "testdata/replication_simulation_default.yaml"
	TasklistName    = "test-tasklist"

	TimerInterval = 5 * time.Second
)

Variables

This section is empty.

Functions

func Logf

func Logf(t *testing.T, msg string, args ...interface{})

func WorkerIdentityFor

func WorkerIdentityFor(clusterName string, domainName string) string

Types

type Cluster

type Cluster struct {
	GRPCEndpoint string `yaml:"grpcEndpoint"`

	AdminClient    admin.Client    `yaml:"-"`
	FrontendClient frontend.Client `yaml:"-"`
}

type Operation

type Operation struct {
	Type          ReplicationSimulationOperation `yaml:"op"`
	At            time.Duration                  `yaml:"at"`
	Cluster       string                         `yaml:"cluster"`
	SourceCluster string                         `yaml:"sourceCluster"`
	TargetCluster string                         `yaml:"targetCluster"`

	WorkflowType                         string        `yaml:"workflowType"`
	WorkflowID                           string        `yaml:"workflowID"`
	WorkflowExecutionStartToCloseTimeout time.Duration `yaml:"workflowExecutionStartToCloseTimeout"`
	WorkflowDuration                     time.Duration `yaml:"workflowDuration"`
	ActivityCount                        int           `yaml:"activityCount"`
	DelayStartSeconds                    int32         `yaml:"delayStartSeconds"`
	CronSchedule                         string        `yaml:"cronSchedule"`

	Query            string `yaml:"query"`
	ConsistencyLevel string `yaml:"consistencyLevel"`

	SignalName  string `yaml:"signalName"`
	SignalInput any    `yaml:"signalInput"`

	EventID int64 `yaml:"eventID"`

	Domain                    string            `yaml:"domain"`
	NewActiveCluster          string            `yaml:"newActiveCluster"`
	NewActiveClustersByRegion map[string]string `yaml:"newActiveClustersByRegion"`
	FailoverTimeout           *int32            `yaml:"failoverTimeoutSec"`

	Want Validation `yaml:"want"`
}

type ReplicationDomainConfig added in v1.3.0

type ReplicationDomainConfig struct {
	ActiveClusterName string `yaml:"activeClusterName"`

	ActiveClustersByRegion map[string]string `yaml:"activeClustersByRegion"`
}

type ReplicationSimulationConfig

type ReplicationSimulationConfig struct {
	// Clusters is the map of all clusters
	Clusters map[string]*Cluster `yaml:"clusters"`

	// PrimaryCluster is used for domain registration
	PrimaryCluster string `yaml:"primaryCluster"`

	Domains map[string]ReplicationDomainConfig `yaml:"domains"`

	Operations []*Operation `yaml:"operations"`
}

func LoadConfig

func LoadConfig() (*ReplicationSimulationConfig, error)

func (*ReplicationSimulationConfig) IsActiveActiveDomain added in v1.3.0

func (s *ReplicationSimulationConfig) IsActiveActiveDomain(domainName string) bool

func (*ReplicationSimulationConfig) MustGetFrontendClient

func (s *ReplicationSimulationConfig) MustGetFrontendClient(t *testing.T, clusterName string) frontend.Client

func (*ReplicationSimulationConfig) MustInitClientsFor

func (s *ReplicationSimulationConfig) MustInitClientsFor(t *testing.T, clusterName string)

func (*ReplicationSimulationConfig) MustRegisterDomain

func (s *ReplicationSimulationConfig) MustRegisterDomain(t *testing.T, domainName string, domainCfg ReplicationDomainConfig)

type ReplicationSimulationOperation

type ReplicationSimulationOperation string
const (
	ReplicationSimulationOperationStartWorkflow               ReplicationSimulationOperation = "start_workflow"
	ReplicationSimulationOperationResetWorkflow               ReplicationSimulationOperation = "reset_workflow"
	ReplicationSimulationOperationChangeActiveClusters        ReplicationSimulationOperation = "change_active_clusters"
	ReplicationSimulationOperationValidate                    ReplicationSimulationOperation = "validate"
	ReplicationSimulationOperationQueryWorkflow               ReplicationSimulationOperation = "query_workflow"
	ReplicationSimulationOperationSignalWithStartWorkflow     ReplicationSimulationOperation = "signal_with_start_workflow"
	ReplicationSimulationOperationMigrateDomainToActiveActive ReplicationSimulationOperation = "migrate_domain_to_active_active"
	ReplicationSimulationOperationValidateWorkflowReplication ReplicationSimulationOperation = "validate_workflow_replication"
)

type Validation

type Validation struct {
	Status                      string `yaml:"status"`
	StartedByWorkersInCluster   string `yaml:"startedByWorkersInCluster"`
	CompletedByWorkersInCluster string `yaml:"completedByWorkersInCluster"`
	Error                       string `yaml:"error"`
	QueryResult                 any    `yaml:"queryResult"`
}

type WorkflowInput

type WorkflowInput struct {
	Duration      time.Duration
	ActivityCount int
}

type WorkflowOutput

type WorkflowOutput struct {
	Count int
}

Jump to

Keyboard shortcuts

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