Documentation
¶
Overview ¶
Package allocs isolates allocation assertions from parallel test activity.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsChildProcess ¶
func IsChildProcess() bool
IsChildProcess reports the exact subprocess invocation made by Run. TestMain may use this to avoid starting background services for an allocation-only test. An environment marker without the matching test filter is insufficient.
func Run ¶
Run executes measure in a fresh copy of the test executable containing only this top-level test. Subtests are rejected: their parent setup can start concurrent work, and Go splits -test.run patterns on slashes rather than matching the full name. Call it from a parallel test, but do not start background work in measure: testing.Benchmark reads process-wide MemStats, not per-goroutine allocation counters. Parent tests stay parallel; their allocations cannot enter the child's measurement. The original assertion and threshold run in the child and any failure, timeout, or missing execution marker fails here.
Types ¶
This section is empty.