Skip to content
Commit 48785b0e authored by Daniel Kahn Gillmor's avatar Daniel Kahn Gillmor
Browse files

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)
parent 97ade311
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment