Expand description
Support for double-spawning test processes.
Nextest has experimental support on Unix for spawning test processes twice, to enable better isolation and solve some thorny issues.
§Issues this currently solves
§posix_spawn
SIGTSTP race
It’s been empirically observed that if nextest receives a SIGTSTP
(Ctrl-Z) while it’s running,
it can get completely stuck sometimes. This is due to a race between the child being spawned and it
receiving a SIGTSTP
signal.
For more details, see this message on the glibc-help mailing list.
To solve this issue, we do the following:
- In the main nextest runner process, using
DoubleSpawnContext
, blockSIGTSTP
in the current thread (usingpthread_sigmask
) before spawning the stub child cargo-nextest process. - In the stub child process, unblock
SIGTSTP
.
With this approach, the race condition between posix_spawn and SIGTSTP
no longer exists.
Structs§
- Context to be used before spawning processes and dropped afterwards.
- Information about double-spawning processes. This determines whether a process will be double-spawned.
Functions§
- Initialization for the double-spawn child.