From owner-svn-src-head@freebsd.org Mon Aug 5 22:59:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 01491AFD58; Mon, 5 Aug 2019 22:59:36 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462Y9z6HPcz4LPp; Mon, 5 Aug 2019 22:59:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B52B422CFB; Mon, 5 Aug 2019 22:59:35 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x75MxZgH084702; Mon, 5 Aug 2019 22:59:35 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x75MxZ6U084701; Mon, 5 Aug 2019 22:59:35 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201908052259.x75MxZ6U084701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Mon, 5 Aug 2019 22:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r350620 - head/contrib/netbsd-tests/lib/libpthread X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: head/contrib/netbsd-tests/lib/libpthread X-SVN-Commit-Revision: 350620 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Aug 2019 22:59:36 -0000 Author: vangyzen Date: Mon Aug 5 22:59:35 2019 New Revision: 350620 URL: https://svnweb.freebsd.org/changeset/base/350620 Log: Relax time constraint in pthread_cond_timedwait unit test pthread_cond_timedwait() should wait _at least_ until the timeout, but it might appear to wait longer due to system activity and scheduling. The test ignored fractional seconds when comparing the actual and expected timeouts, so it allowed anywhere between zero and one extra second of wait time. Zero is a bit unreasonable. Compare fractional seconds so we always allow up to one extra second. Reviewed by: ngie MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/contrib/netbsd-tests/lib/libpthread/t_condwait.c Modified: head/contrib/netbsd-tests/lib/libpthread/t_condwait.c ============================================================================== --- head/contrib/netbsd-tests/lib/libpthread/t_condwait.c Mon Aug 5 22:04:16 2019 (r350619) +++ head/contrib/netbsd-tests/lib/libpthread/t_condwait.c Mon Aug 5 22:59:35 2019 (r350620) @@ -51,6 +51,9 @@ static void * run(void *param) { struct timespec ts, to, te; +#ifdef __FreeBSD__ + struct timespec tw; +#endif clockid_t clck; pthread_condattr_t attr; pthread_cond_t cond; @@ -91,7 +94,15 @@ run(void *param) /* Loose upper limit because of qemu timing bugs */ ATF_REQUIRE(to_seconds < WAITTIME * 2.5); } else { +#ifdef __FreeBSD__ + tw.tv_sec = WAITTIME; + tw.tv_nsec = 0; + ATF_REQUIRE(timespeccmp(&to, &tw, >=)); + tw.tv_sec++; + ATF_REQUIRE(timespeccmp(&to, &tw, <=)); +#else ATF_REQUIRE_EQ(to.tv_sec, WAITTIME); +#endif } break; default: