Bug 240621 - Flakey test case: lib.libc.sys.stat_test.stat_socket
Summary: Flakey test case: lib.libc.sys.stat_test.stat_socket
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: tests (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Mark Johnston
URL:
Keywords:
: 219875 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-09-17 02:17 UTC by Li-Wen Hsu
Modified: 2022-04-19 14:01 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Li-Wen Hsu freebsd_committer 2019-09-17 02:17:12 UTC
This at least started failing from: https://ci.freebsd.org/job/FreeBSD-head-amd64-test/10016/testReport/junit/lib.libc.sys/stat_test/stat_socket/

The some other examples:
https://ci.freebsd.org/job/FreeBSD-head-amd64-test/11178/testReport/junit/lib.libc.sys/stat_test/stat_socket/
https://ci.freebsd.org/job/FreeBSD-head-amd64-test/12581/testReport/junit/lib.libc.sys/stat_test/stat_socket/

Error Message:

/usr/src/contrib/netbsd-tests/lib/libc/sys/t_stat.c:355: Expected errno 36, got 61, in connect(fd, (struct sockaddr *)&addr, sizeof(struct sockaddr_in)) == -1
Comment 1 commit-hook freebsd_committer 2019-09-17 14:08:55 UTC
A commit references this bug:

Author: lwhsu
Date: Tue Sep 17 14:08:09 UTC 2019
New revision: 352448
URL: https://svnweb.freebsd.org/changeset/base/352448

Log:
  Temporarily skip flakey test case lib.libc.sys.stat_test.stat_socket

  PR:		240621
  Sponsored by:	The FreeBSD Foundation

Changes:
  head/contrib/netbsd-tests/lib/libc/sys/t_stat.c
Comment 2 Ed Maste freebsd_committer 2019-12-18 16:31:06 UTC
I'm not sure how this test is expected to (consistently) work. It does a O_NONBLOCK connect(2) to 127.0.0.1:42 and requires that errno is EINPROGRESS.
Comment 3 commit-hook freebsd_committer 2022-01-14 20:39:39 UTC
A commit in branch main references this bug:

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

commit 95c75073d3d1ca9dcae41784453172f199bb2c0f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-01-14 20:00:01 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-01-14 20:01:41 +0000

    netbsd-tests: Fix the libc stat_socket test

    The test tries to connect a socket to a closed port at 127.0.0.1.  It
    sets O_NONBLOCK on the socket first and expects to get EINPROGRESS from
    connect(2), but this is not guaranteed, ECONNREFUSED is possible.
    Handle both cases, and re-enable the test.

    PR:             240621
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation

 contrib/netbsd-tests/lib/libc/sys/t_stat.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
Comment 4 commit-hook freebsd_committer 2022-01-21 00:54:17 UTC
A commit in branch stable/13 references this bug:

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

commit 812345b1d469e5bb90f5487fef1e4ab16890cc7a
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-01-14 20:00:01 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-01-21 00:52:36 +0000

    netbsd-tests: Fix the libc stat_socket test

    The test tries to connect a socket to a closed port at 127.0.0.1.  It
    sets O_NONBLOCK on the socket first and expects to get EINPROGRESS from
    connect(2), but this is not guaranteed, ECONNREFUSED is possible.
    Handle both cases, and re-enable the test.

    PR:             240621
    Sponsored by:   The FreeBSD Foundation

    (cherry picked from commit 95c75073d3d1ca9dcae41784453172f199bb2c0f)

 contrib/netbsd-tests/lib/libc/sys/t_stat.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
Comment 5 commit-hook freebsd_committer 2022-01-21 00:56:18 UTC
A commit in branch stable/12 references this bug:

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

commit 9f192dd79cce2ea53a1cdc3ab64ea204a2fb9d84
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2022-01-14 20:00:01 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2022-01-21 00:53:44 +0000

    netbsd-tests: Fix the libc stat_socket test

    The test tries to connect a socket to a closed port at 127.0.0.1.  It
    sets O_NONBLOCK on the socket first and expects to get EINPROGRESS from
    connect(2), but this is not guaranteed, ECONNREFUSED is possible.
    Handle both cases, and re-enable the test.

    PR:             240621
    Sponsored by:   The FreeBSD Foundation

    (cherry picked from commit 95c75073d3d1ca9dcae41784453172f199bb2c0f)

 contrib/netbsd-tests/lib/libc/sys/t_stat.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Comment 6 Mark Johnston freebsd_committer 2022-04-19 14:01:35 UTC
*** Bug 219875 has been marked as a duplicate of this bug. ***