childproc

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package childproc helps tests that run stand-in processes (a fake OpenResty, the test binary as a node) and wait for what those record. The waits end shortly before the go test -timeout deadline, not after a fixed time: on a loaded machine a process start alone can take seconds.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(t *testing.T) context.Context

Context is t.Context() ending at Deadline(t).

func Deadline

func Deadline(t *testing.T) time.Time

Deadline is when a test stops waiting for its processes: a tenth of the remaining time before go test -timeout, so the test fails with its own message rather than the binary's timeout panic; a day from now with -timeout 0.

func UnignoreSIGHUP

func UnignoreSIGHUP()

UnignoreSIGHUP makes the processes a test starts receive SIGHUP. A test started with SIGHUP ignored (nohup) passes that on to its children, and a shell cannot trap a signal that was ignored when it started, so a fake OpenResty would never record a reload. Notify replaces an inherited SIG_IGN of SIGHUP with a handler (os/signal), and children start with the default action instead. The test process itself still drops SIGHUP. Call it from TestMain.

func Wait

func Wait(t *testing.T, what string, cond func() bool)

Wait polls cond until it holds, failing the test at Deadline(t).

Types

This section is empty.

Jump to

Keyboard shortcuts

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