From e459d018f2c7326c64587c28a0760819b31f2ef5 Mon Sep 17 00:00:00 2001 From: Sylvain78 Date: Thu, 4 Apr 2024 14:56:19 +0000 Subject: [PATCH] Haiku Rationale : POSIX is clear that signal ordering is not guaranteed. On Haiku, SIGKILL is sent at higher priority than SIGUSR1 so it is signaled before. Here the goal is just to test the masking, so i change for SIGUSR2 at same level. Though i am aware there should be a cleaner way to test signal masking, this change gets the signals to be delivered in same order. This solved the FAILED test on Haiku. --- test/tests.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tests.ml b/test/tests.ml index 117cdff..ed61aba 100644 --- a/test/tests.ml +++ b/test/tests.ml @@ -165,13 +165,13 @@ let%test_unit "sigprocmask" = let prog = Program_lookup.find_prog "sleep" in let pid = Spawn.spawn ?sigprocmask ~prog ~argv:[ "sleep"; "60" ] () in Unix.kill pid Sys.sigusr1; - Unix.kill pid Sys.sigkill; + Unix.kill pid Sys.sigusr2; match Unix.waitpid [] pid with | _, WSIGNALED signal -> assert (signal = expected_signal) | _ -> failwith "unexpected" in run Sys.sigusr1; - run ~sigprocmask:(SIG_BLOCK, [ Sys.sigusr1 ]) Sys.sigkill) + run ~sigprocmask:(SIG_BLOCK, [ Sys.sigusr1 ]) Sys.sigusr2) ;; (* This should be at the end to clean up the test environment *)