From f21a9340cd0c615ead1954eb6b93845a4f8c0897 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 14 Dec 2022 12:19:31 -0500 Subject: tests/posix/readdir_error: Fix flakiness --- tests/posix/readdir_error.sh | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) (limited to 'tests/posix') diff --git a/tests/posix/readdir_error.sh b/tests/posix/readdir_error.sh index cca71f0..ce06723 100644 --- a/tests/posix/readdir_error.sh +++ b/tests/posix/readdir_error.sh @@ -1,21 +1,37 @@ +skip_unless test "$UNAME" = "Linux" + clean_scratch -mkfifo scratch/{pid,hup} +mkfifo scratch/{fever,pid,wait,running} ( # Create a zombie process - echo >/dev/null & + cat scratch/fever >/dev/null & # Write the PID to scratch/pid echo $! >scratch/pid - # Don't wait on the processes - exec cat scratch/hup >/dev/null + # Don't wait on the zombie process + exec cat scratch/wait scratch/fever >scratch/running ) & -# Kill cat on exit -trap "echo >scratch/hup" EXIT +# Kill the parent cat on exit +trap "kill -9 %1" EXIT -# Read the zombie PID +# Read the child PID read -r pid scratch/wait & +read -r _ /dev/null -- cgit v1.2.3