Bug 233649 - Flakey test case: sys.kern.sysv_test.msg
Summary: Flakey test case: sys.kern.sysv_test.msg
Status: In Progress
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Eric van Gyzen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-29 22:43 UTC by Li-Wen Hsu
Modified: 2022-05-13 21:40 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Comment 2 commit-hook freebsd_committer 2020-06-26 17:58:28 UTC
A commit references this bug:

Author: lwhsu
Date: Fri Jun 26 17:58:11 UTC 2020
New revision: 362656
URL: https://svnweb.freebsd.org/changeset/base/362656

Log:
  Temporarily skip flakey sys.kern.sysv_test.msg in CI

  PR:		233649

Changes:
  head/contrib/netbsd-tests/kernel/t_sysv.c
Comment 3 commit-hook freebsd_committer 2020-06-26 18:02:30 UTC
A commit references this bug:

Author: lwhsu
Date: Fri Jun 26 18:01:35 UTC 2020
New revision: 362657
URL: https://svnweb.freebsd.org/changeset/base/362657

Log:
  MFC r362656:

  Temporarily skip flakey sys.kern.sysv_test.msg in CI

  PR:		233649

Changes:
_U  stable/12/
  stable/12/contrib/netbsd-tests/kernel/t_sysv.c
Comment 4 commit-hook freebsd_committer 2020-06-26 18:02:31 UTC
A commit references this bug:

Author: lwhsu
Date: Fri Jun 26 18:01:58 UTC 2020
New revision: 362658
URL: https://svnweb.freebsd.org/changeset/base/362658

Log:
  MFC r362656:

  Temporarily skip flakey sys.kern.sysv_test.msg in CI

  PR:		233649

Changes:
_U  stable/11/
  stable/11/contrib/netbsd-tests/kernel/t_sysv.c
Comment 5 Eric van Gyzen freebsd_committer 2022-05-12 16:11:12 UTC
I ran the test under GDB and reproduced the hang.  The test blocks in sigsuspend.  did_sigchild is already 1.  The child exited before the parent called sigsuspend, so it will block forever.  The parent should simply use a wait-family function to wait for the child.  Then it could also ignore SIGCHLD.
Comment 6 Eric van Gyzen freebsd_committer 2022-05-12 16:14:45 UTC
NetBSD ToT still has this bug.
Comment 7 Eric van Gyzen freebsd_committer 2022-05-12 22:45:39 UTC
https://reviews.freebsd.org/D35187
Comment 8 commit-hook freebsd_committer 2022-05-13 21:40:14 UTC
A commit in branch main references this bug:

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

commit 20917cac7bcf216225a7b66f7b3a56f3764c5acc
Author:     Eric van Gyzen <vangyzen@FreeBSD.org>
AuthorDate: 2022-05-12 14:50:02 +0000
Commit:     Eric van Gyzen <vangyzen@FreeBSD.org>
CommitDate: 2022-05-13 16:38:26 +0000

    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

 contrib/netbsd-tests/kernel/t_sysv.c | 201 ++++++++++-------------------------
 1 file changed, 59 insertions(+), 142 deletions(-)