git: b09eed11cf20 - stable/13 - netbsd-tests: Remove some pointless sleeps from message queue tests

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Mon, 20 Mar 2023 13:33:41 UTC
The branch stable/13 has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=b09eed11cf20101e9249aecf8ca83e2be6df5947

commit b09eed11cf20101e9249aecf8ca83e2be6df5947
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-03-10 22:06:46 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-03-20 12:52:07 +0000

    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
    
    (cherry picked from commit 478de7f8e25849ce0b3a37b4baaf9c69e0b34072)
---
 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)