From bd5d113c05cd5e6b7c2ad658872c43c227240525 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Thu, 26 Sep 2024 18:56:45 -0500 Subject: [PATCH] tests: initial caught before we signal ready in resized.sh Incredibly obvious in hindsight, but it's quite possible to race a WINCH event vs. initialization of caught and end up with a mismatch in expected signal catches. This was super-reliably hit in my OpenBSD 7.5 VM. Signed-off-by: Kyle Evans --- .gitignore | 1 + tests/resized.sh | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 617c672..a84d4a6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ build .*.swp *.o *.bak +*.orig *.core *.debug *.full diff --git a/tests/resized.sh b/tests/resized.sh index d931425..9100821 100755 --- a/tests/resized.sh +++ b/tests/resized.sh @@ -1,6 +1,7 @@ #!/bin/sh loop=1 +caught=0 trap 'echo resized; caught=$((caught + 1))' WINCH trap 'loop=0' INT @@ -8,8 +9,6 @@ trap 'loop=0' INT # Release the hounds now that the signal handler is setup. echo "ready" -caught=0 - while [ "$loop" -ne 0 ]; do sleep 1 done