tests/keytrans: Avoid hangs when run with subprocesses
When bash 5.0 uses process replacement [0], the main process gets invoked with child processes already present. This wreaks havoc with our understanding of what "wait" does, and can make the test suite hang (see https://bugs.debian.org/920038). So we introduce this check to make sure that there are no running subprocesses. This is particularly problematic because debian's autopkgtest *does* invoke the test suite in this way. Note that there might be some weird race condition here -- we allow there to be 1 subprocess, which is the spawned "ps" program itself. but how ps works on a given platform, and whether it will notice (and count) itself, i don't know. But it WorksForMe™ on debian buster. [0] e.g., bash's process replacement looks like this: tests/keytrans > >(tee $TMPDIR/stdout)
Loading
Please register or sign in to comment