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 Deadline ¶
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.
Types ¶
This section is empty.