A test binary's own directory is removed twice over before it is checked, so a child still exiting cannot fail the run

This commit is contained in:
Joseph Ferano 2026-09-25 09:44:02 +07:00
parent 6a1182df5d
commit 931000fcb5

View File

@ -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 ->