From 045683f9273bf32be76c22192fc61a99d9f941fd Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Fri, 17 Jun 2022 09:33:42 +0200 Subject: [PATCH] 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 --- tests/checks/fds.fish | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/checks/fds.fish b/tests/checks/fds.fish index c2a60bb1f..de581e4b2 100644 --- a/tests/checks/fds.fish +++ b/tests/checks/fds.fish @@ -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