From a78cd48aa3cb7ef29ee971b235859e1f5ee5481c Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Thu, 3 Oct 2024 13:41:10 +0200 Subject: [PATCH] remove posix signal test, it isn't thread safe --- tests/core/sys/posix/posix.odin | 48 --------------------------------- 1 file changed, 48 deletions(-) diff --git a/tests/core/sys/posix/posix.odin b/tests/core/sys/posix/posix.odin index 760ddc1fb..d73e49ffb 100644 --- a/tests/core/sys/posix/posix.odin +++ b/tests/core/sys/posix/posix.odin @@ -1,8 +1,6 @@ #+build darwin, freebsd, openbsd, netbsd package tests_core_posix -import "base:runtime" - import "core:log" import "core:path/filepath" import "core:strings" @@ -217,52 +215,6 @@ test_termios :: proc(t: ^testing.T) { testing.expect_value(t, transmute(posix.COutput_Flags)posix.tcflag_t(posix._FFDLY), posix.FFDLY) } -@(test) -test_signal :: proc(t: ^testing.T) { - @static tt: ^testing.T - tt = t - - @static ctx: runtime.Context - ctx = context - - act: posix.sigaction_t - act.sa_flags = {.SIGINFO, .RESETHAND} - act.sa_sigaction = handler - testing.expect_value(t, posix.sigaction(.SIGCHLD, &act, nil), posix.result.OK) - - handler :: proc "c" (sig: posix.Signal, info: ^posix.siginfo_t, address: rawptr) { - context = ctx - testing.expect_value(tt, sig, posix.Signal.SIGCHLD) - testing.expect_value(tt, info.si_signo, posix.Signal.SIGCHLD) - testing.expect_value(tt, info.si_status, 69) - testing.expect_value(tt, info.si_code.chld, posix.CLD_Code.EXITED) - } - - switch pid := posix.fork(); pid { - case -1: - log.errorf("fork() failure: %v", posix.strerror()) - case 0: - posix.exit(69) - case: - for { - status: i32 - res := posix.waitpid(pid, &status, {}) - if res == -1 { - if !testing.expect_value(t, posix.errno(), posix.Errno.EINTR) { - break - } - continue - } - - if posix.WIFEXITED(status) || posix.WIFSIGNALED(status) { - testing.expect(t, posix.WIFEXITED(status)) - testing.expect(t, posix.WEXITSTATUS(status) == 69) - break - } - } - } -} - @(test) test_pthreads :: proc(t: ^testing.T) { testing.set_fail_timeout(t, time.Second)