tests/fd: Error out early if more fds are open

This is simply an error in test setup. There's a limit to how far we
can isolate them from the system.

(it's possible new cmake versions close fds automatically since I
can't reproduce the original issue via `ninja test` or `make test`)

Fixes #9017
This commit is contained in:
Fabian Boehm 2022-06-17 09:33:42 +02:00
parent 4f0c0486a6
commit 045683f927

View file

@ -2,6 +2,14 @@
# Check that we don't leave stray FDs.
set -l fds ($helper print_fds)
test "$fds" = "0 1 2"
or begin
echo This test needs to have all fds other than 0 1 and 2 closed before running >&2
echo Please close the other fds and try again >&2
exit 1
end
$helper print_fds
# CHECK: 0 1 2