[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 01/04: tests: Make file descriptor count deterministic.
From: |
Ludovic Courtès |
Subject: |
[shepherd] 01/04: tests: Make file descriptor count deterministic. |
Date: |
Sat, 10 Sep 2022 17:05:48 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit 8287dbc9e65e6f195871f0fb2131f7aad9c7aff7
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Sat Sep 10 21:19:18 2022 +0200
tests: Make file descriptor count deterministic.
* tests/inetd.sh: Run "herd eval root (gc)" before setting
'initial_fd_count'.
---
tests/inetd.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/inetd.sh b/tests/inetd.sh
index 0301b68..5d1c6d1 100644
--- a/tests/inetd.sh
+++ b/tests/inetd.sh
@@ -95,6 +95,11 @@ file_descriptor_count ()
ls -l /proc/$shepherd_pid/fd/[0-9]* | wc -l
}
+# Trigger startup of the finalizer thread, which creates a couple of pipes.
+# That way, those extra file descriptors won't influence the comparison with
+# INITIAL_FD_COUNT done at the end.
+$herd eval root '(gc)'
+
initial_fd_count=$(file_descriptor_count)
$herd status test-inetd | grep started