Documentation
¶
Index ¶
- Constants
- func ChannelName(n int) string
- func RegisterAll(registry *autocore.Registry) error
- type Scenario
- func ActivityWithRetries() Scenario
- func AllScenarios() []Scenario
- func ChildWorkflowBasic() Scenario
- func ChildWorkflowCancelFanout() Scenario
- func ChildWorkflowDetached() Scenario
- func DeepSelector() Scenario
- func ExhaustSignalCap() Scenario
- func Fanout() Scenario
- func FanoutWithRetries() Scenario
- func InlineActivityBasic() Scenario
- func InlineActivityFailure() Scenario
- func LongTimer() Scenario
- func NestedTimers() Scenario
- func NondeterministicPanic() Scenario
- func Noop() Scenario
- func PanicOnAttempt() Scenario
- func SignalConsumer() Scenario
- func SingleActivity() Scenario
Constants ¶
const ( ActivityNoop autocore.ActivityName[*scenariospb.NoopActivityInput, *scenariospb.NoopActivityOutput] = "noop_activity" ActivityPanic autocore.ActivityName[*emptypb.Empty, *emptypb.Empty] = "panic_activity" )
const ( NameFanout autocore.WorkflowName[*scenariospb.FanoutInput, *emptypb.Empty] = "fanout" NameFanoutWithRetries autocore.WorkflowName[*scenariospb.FanoutInput, *emptypb.Empty] = "fanout_with_retries" )
const FirstChannelName = autocore.ReservedPrefix + "ch:1"
FirstChannelName is the name autocore generates for the first channel a workflow creates, so it is what a sender addresses to reach the first channel of a scenario that creates its channels up front.
const NameActivityWithRetries autocore.WorkflowName[*scenariospb.ActivityWithRetriesInput, *emptypb.Empty] = "activity_with_retries"
const NameChildWorkflowBasic autocore.WorkflowName[*scenariospb.ChildWorkflowBasicInput, *emptypb.Empty] = "child_workflow_basic"
const NameChildWorkflowCancelFanout autocore.WorkflowName[*scenariospb.ChildWorkflowCancelFanoutInput, *emptypb.Empty] = "child_workflow_cancel_fanout"
const NameChildWorkflowDetached autocore.WorkflowName[*scenariospb.ChildWorkflowDetachedInput, *emptypb.Empty] = "child_workflow_detached"
const NameChildWorkflowInner autocore.WorkflowName[*scenariospb.NoopChildInput, *emptypb.Empty] = "child_workflow_inner"
NameChildWorkflowInner is the workflow function shared by every child-workflow scenario. The parent picks the child's behavior via NoopChildInput.sleep: 0 means return immediately (basic); a small value means brief lifecycle visibility (detached); a long value (longer than the cancel-fanout window) lets the cancel propagate before the child completes naturally.
const NameDeepSelector autocore.WorkflowName[*scenariospb.DeepSelectorInput, *emptypb.Empty] = "deep_selector"
const NameExhaustSignalCap autocore.WorkflowName[*scenariospb.ExhaustSignalCapInput, *emptypb.Empty] = "exhaust_signal_cap"
const NameInlineActivityBasic autocore.WorkflowName[*scenariospb.InlineActivityBasicInput, *emptypb.Empty] = "inline_activity_basic"
const NameInlineActivityFailure autocore.WorkflowName[*scenariospb.InlineActivityFailureInput, *emptypb.Empty] = "inline_activity_failure"
const NameLongTimer autocore.WorkflowName[*scenariospb.LongTimerInput, *emptypb.Empty] = "long_timer"
const NameNestedTimers autocore.WorkflowName[*scenariospb.NestedTimersInput, *emptypb.Empty] = "nested_timers"
const NameNondeterministicPanic autocore.WorkflowName[*scenariospb.NondeterministicPanicInput, *emptypb.Empty] = "nondeterministic_panic"
const NameNoop autocore.WorkflowName[*scenariospb.NoopInput, *scenariospb.NoopInput] = "noop"
const NamePanicOnAttempt autocore.WorkflowName[*scenariospb.PanicOnAttemptInput, *emptypb.Empty] = "panic_on_attempt"
const NameSignalConsumer autocore.WorkflowName[*scenariospb.SignalConsumerInput, *emptypb.Empty] = "signal_consumer"
const NameSingleActivity autocore.WorkflowName[*scenariospb.SingleActivityInput, *emptypb.Empty] = "single_activity"
Variables ¶
This section is empty.
Functions ¶
func ChannelName ¶
ChannelName returns the name autocore generates for the n-th (1-based) channel a workflow creates, for scenarios that create their channels up front in a deterministic order.
func RegisterAll ¶
Types ¶
type Scenario ¶
type Scenario struct {
Name string
Register func(r *autocore.Registry) error
// NewInput returns a populated input proto for one execution. failProb
// is the config-supplied failure probability; scenarios that need a
// non-zero default apply it when failProb is 0.
NewInput func(rng *rand.Rand, failProb float32) proto.Message
// NewDrive returns the drive script for one execution: the external
// operations (channel sends, cancellation) the driver performs against the
// workflow. Derived from the same input NewInput produced. Nil when the
// scenario needs no external driving.
NewDrive func(rng *rand.Rand, input proto.Message) []flowtest.DriveOp
// Expect returns the allowed terminal states for one execution with the
// given input, derived from the scenario's semantics and its drive script.
Expect func(input proto.Message) []flowtest.TerminalState
}
func ActivityWithRetries ¶
func ActivityWithRetries() Scenario
func AllScenarios ¶
func AllScenarios() []Scenario
func ChildWorkflowBasic ¶
func ChildWorkflowBasic() Scenario
func ChildWorkflowCancelFanout ¶
func ChildWorkflowCancelFanout() Scenario
func ChildWorkflowDetached ¶
func ChildWorkflowDetached() Scenario
func DeepSelector ¶
func DeepSelector() Scenario
func ExhaustSignalCap ¶
func ExhaustSignalCap() Scenario
func FanoutWithRetries ¶
func FanoutWithRetries() Scenario
FanoutWithRetries shares the same workflow function as Fanout. The two scenarios differ only in the params the driver supplies: FanoutWithRetries is generated with a non-zero retry policy + non-zero fail probability so most activities recover via retry and a minority exhaust the budget.
func InlineActivityBasic ¶
func InlineActivityBasic() Scenario
func InlineActivityFailure ¶
func InlineActivityFailure() Scenario
func NestedTimers ¶
func NestedTimers() Scenario
func NondeterministicPanic ¶
func NondeterministicPanic() Scenario
func PanicOnAttempt ¶
func PanicOnAttempt() Scenario
func SignalConsumer ¶
func SignalConsumer() Scenario
func SingleActivity ¶
func SingleActivity() Scenario
Source Files
¶
- activities.go
- activity_with_retries.go
- all.go
- child_workflow_basic.go
- child_workflow_cancel_fanout.go
- child_workflow_detached.go
- child_workflows_inner.go
- deep_selector.go
- exhaust_signal_cap.go
- fanout.go
- inline_activity_basic.go
- inline_activity_failure.go
- long_timer.go
- nested_timers.go
- nondeterministic_panic.go
- noop.go
- panic_on_attempt.go
- registry.go
- signal_consumer.go
- single_activity.go