From 478de7f8e25849ce0b3a37b4baaf9c69e0b34072 Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Fri, 10 Mar 2023 17:06:46 -0500 Subject: [PATCH] netbsd-tests: Remove some pointless sleeps from message queue tests - In the msgctl tests, there is no point in sleeping after a fork(). Just block immediately in wait(). - In non-blocking send/recv tests, just wait for the child to exit once it's reached a message limit. If a bug prevents the child from exiting promptly, the test will time out. MFC after: 1 week --- contrib/netbsd-tests/lib/libc/sys/t_msgctl.c | 2 -- contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c | 2 -- contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c | 2 -- 3 files changed, 6 deletions(-) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c b/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c index 4c145cc89047..098ee91373bf 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_msgctl.c @@ -212,7 +212,6 @@ ATF_TC_BODY(msgctl_pid, tc) _exit(EXIT_SUCCESS); } - (void)sleep(1); (void)wait(&sta); (void)memset(&msgds, 0, sizeof(struct msqid_ds)); @@ -232,7 +231,6 @@ ATF_TC_BODY(msgctl_pid, tc) _exit(EXIT_SUCCESS); } - (void)sleep(1); (void)wait(&sta); (void)memset(&msgds, 0, sizeof(struct msqid_ds)); diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c b/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c index 522ceb82cd38..1bbf6e855acc 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_msgrcv.c @@ -275,8 +275,6 @@ ATF_TC_BODY(msgrcv_nonblock, tc) _exit(EXIT_SUCCESS); } - (void)sleep(2); - (void)kill(pid, SIGKILL); (void)wait(&sta); if (WIFSIGNALED(sta) != 0 || WTERMSIG(sta) == SIGKILL) diff --git a/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c b/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c index 562602a28a79..0251b42ff3d4 100644 --- a/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c +++ b/contrib/netbsd-tests/lib/libc/sys/t_msgsnd.c @@ -265,8 +265,6 @@ ATF_TC_BODY(msgsnd_nonblock, tc) } } - (void)sleep(2); - (void)kill(pid, SIGKILL); (void)wait(&sta); if (WIFEXITED(sta) == 0 || WIFSIGNALED(sta) != 0)