From 931000fcb58270782a186de86dfe721cd6941761 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Fri, 25 Sep 2026 09:44:02 +0700 Subject: [PATCH] A test binary's own directory is removed twice over before it is checked, so a child still exiting cannot fail the run --- test/own_tmp.ml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/own_tmp.ml b/test/own_tmp.ml index 4dda3a77..a3f2453b 100644 --- a/test/own_tmp.ml +++ b/test/own_tmp.ml @@ -84,6 +84,10 @@ let release () = if Unix.getpid () = owner && not !released then begin released := true; remove dir; + (* Twice, because a child still exiting — a daemon's clang, a program + the test just signalled — can write between one pass's [readdir] and + its [rmdir], and a check that fails on that is a flake. *) + if Sys.file_exists dir then remove dir; match leftovers () with | [] -> () | left ->