freebsd-dev/contrib/netbsd-tests/kernel
Eric van Gyzen 20917cac7b sysv test: properly wait for children
In the msg and shm tests, if the child exited before the parent
entered sigsuspend(), the test would hang and time out.  This was
also a problem in the sem test, but the misuse of atf_tc_pass()
masked it.  Adding a short sleep before the sigsuspend() calls made
the hang 100% reliable.  With the same sleep in the new version,
the test passes reliably.

Remove calls to atf_tc_pass().  The call in the sem test broke the test
by exiting prematurely, after only one child out of five had finished.
The other two were harmless but unhelpful.

Reduce a one-second sleep to a more reasonable duration so I can quickly
run many iterations of the test.

Where feasible, assert that wait() returns the child PID.  While I'm here,
use the more succinct ATF_REQUIRE* instead of if/atf_tc_fail/else.

Flush stdout before forking to avoid double-flush.

Use errx() when errno is irrelevant.

Don't use ATF_REQUIRE* in children.  Apparently, the output doesn't
get saved.  The exit status works, so it fails correctly, but silently.

Re-enable the test in CI.

PR:		233649
Reviewed by:	markj (previous version)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D35187
2022-05-13 11:38:26 -05:00
..
arch Merge ^/vendor/NetBSD/tests/dist@r312370 2017-01-18 05:36:09 +00:00
kqueue Add abstime kqueue(2) timers and expand struct kevent members. 2017-06-17 00:57:26 +00:00
tty
gen_t_subr_prf
h_ps_strings1.c
h_ps_strings2.c
msg.h
t_extattrctl.c
t_extent.c Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
t_filedesc.c Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
t_kauth_pr_47598.c
t_lock.c Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
t_lockf.c
t_mqueue.c Pull in ^/vendor/NetBSD/tests/dist@r312219 2017-01-15 10:04:20 +00:00
t_ps_strings.sh
t_ptrace_wait3.c
t_ptrace_wait4.c
t_ptrace_wait6.c
t_ptrace_wait.c Merge in changes from ^/vendor/NetBSD/tests/dist@r313245 2017-02-04 18:20:07 +00:00
t_ptrace_wait.h
t_ptrace_waitid.c
t_ptrace_waitpid.c
t_ptrace.c Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
t_pty.c Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
t_rnd.c Merge content currently under test from ^/vendor/NetBSD/tests/dist/@r312123 2017-01-14 06:49:17 +00:00
t_sysctl.c
t_sysv.c sysv test: properly wait for children 2022-05-13 11:38:26 -05:00
t_umount.sh
t_umountstress.sh