utils

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const EnvAmTestRunner = "AM_TEST_RUNNER"

Variables

View Source
var (
	RelsNodeWorkerSchema = am.SchemaMerge(ssnode.WorkerSchema, ss.States)
	RelsNodeWorkerStates = am.SAdd(ss.Names, ssnode.WorkerStates.Names())
)
View Source
var (
	ConnInit sync.Mutex
)

Functions

func KillProcessesByName added in v0.12.0

func KillProcessesByName(
	processName string) (killedPIDs []int32, errs []error)

KillProcessesByName finds and attempts to terminate all processes with the given name. It returns a slice of PIDs that were successfully terminated and a slice of errors for any processes that could not be terminated.

func NewCustom added in v0.8.0

func NewCustom(t *testing.T, states am.Schema) *am.Machine

NewCustom creates a new machine with custom states.

func NewCustomNetSrc added in v0.17.0

func NewCustomNetSrc(t *testing.T, states am.Schema) *am.Machine

NewCustomNetSrc creates a new worker with custom states.

func NewNoRels

func NewNoRels(t *testing.T, initialState am.S, suffix string) *am.Machine

NewNoRels creates a new machine without relations between states.

func NewNoRelsNetSrc added in v0.17.0

func NewNoRelsNetSrc(
	t *testing.T, initialState am.S, suffix string,
) *am.Machine

NewNoRelsNetSrc creates a new RPC worker without relations between states.

func NewNoRelsNetSrcSchema added in v0.17.0

func NewNoRelsNetSrcSchema(
	t *testing.T, initialState am.S, overlay am.Schema) *am.Machine

NewNoRelsNetSrcSchema creates a new RPC worker without relations between states and applies a schema overlay.

func NewRels

func NewRels(t *testing.T, initialState am.S) *am.Machine

NewRels creates a new machine with basic relations between ABCD states.

func NewRelsNetSrc added in v0.17.0

func NewRelsNetSrc(t *testing.T, initialState am.S) *am.Machine

NewRelsNetSrc creates a new network source machine with basic relations between ABCD states.

func NewRelsNodeWorker added in v0.8.0

func NewRelsNodeWorker(t *testing.T, initialState am.S) *am.Machine

NewRelsNodeWorker creates a new Node worker machine with basic relations between ABCD states.

func RandListener

func RandListener(host string) net.Listener

RandListener creates a new listener on an open port between 40000 and 50000. It allows avoiding conflicts with other tests, using predefined addresses, unlike using port 0.

func RandPort

func RandPort(min, max int) string

Types

This section is empty.

Jump to

Keyboard shortcuts

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