Help us shape the future of Go! Take the 2026 Go Developer Survey

capledgerproc

package
v0.23.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package capledgerproc runs the cap ledger across real worker processes (re-executions of a store's test binary) for the tests of bide's stores. It is internal and starts a process, so only the store modules' tests import it (audit uses capledgertest, which starts none).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsWorker

func IsWorker() bool

IsWorker reports whether this process is a worker; a store's TestMain calls WorkerMain then.

func Run

func Run(t *testing.T, j *agent.Journal, p Params, env []string)

Run starts p.Procs workers over the store that env (for the workers' open function) names, waits for them, and checks the ledger through j.

func WorkerMain

func WorkerMain(open func(ctx context.Context) (*agent.Journal, func(), error)) int

WorkerMain is a worker process: it opens its journal with open, waits for the start instant, reserves the shared attempts and then its own, printing one line per attempt ("ok <tool>" or "over <tool>"), and returns the exit code.

Types

type Params

type Params struct {
	Procs  int   // worker processes
	Own    int   // attempts each worker reserves of its own
	Shared int   // attempts every worker reserves, first
	Limit  int64 // the window's limit; each attempt reserves 1
	// Namespace names the rule's ledger, and prefixes the attempts, so a run of the test never meets
	// the slots or intents of an earlier one in a database that persists: the test gives each run its own.
	Namespace string
	// Release adds a phase after every reservation: each worker releases its first own attempt, then all
	// workers race to release the first shared attempt through Release and the second through a reconcile
	// pass; each shared slot must be released exactly once.
	Release bool
	// Kill SIGKILLs one worker in the middle of its reservations and starts a replacement of the same name.
	Kill bool
}

Params are the numbers of a multi-process run.

func (Params) String

func (p Params) String() string

String encodes the parameters for a worker's environment.

Jump to

Keyboard shortcuts

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