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 ¶
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 ¶
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
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.