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