From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) by sourceware.org (Postfix) with ESMTPS id 6A2933850433 for ; Wed, 24 Mar 2021 19:47:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6A2933850433 Received: by mail-qv1-xf2b.google.com with SMTP id by2so12890491qvb.11 for ; Wed, 24 Mar 2021 12:47:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Nb9IT6BGUicTZBsKXtLVwTWNqVLfq/eCfrf7nzpZUuM=; b=bjHwA/vMZKLOj7onVtS+noW4AkIt3/XvFaZzvNHivPefGAoF8c2bCjvqAZmYh3dXC2 aUQMnKL7T9FDvO4Wqz8ynAe7W1kYYLkDuLYkcRT6bKiq29g1LvrFv9VajfTXL9mUOgB9 2Hn2jFBhwVGDrqYufR2zDYiMV073sLMvAZVKgyUZxWNBo6rQYJ+G2e+O4QxaumLRm86u HS/Euey9PQB4SOVKUN5y8xLJnDdTUBJzRFqrJ8YfbW2Aljq16qndR8pyFCXEwfv6MuUP Ewummv8mYHm6htDSxyLIeVLF2gkUF+8tbYpSUUeWbwv4tcQIT8YyFMVFQI9eLkkLpahG o0GQ== X-Gm-Message-State: AOAM531sLPNzDTJbXZDA827k9AJ7iyLIXO99O5ovdShMaK3Yy+4kKE4j Us2W3nehqloV5XD55/VbVT6MKgHk2HjdYw== X-Google-Smtp-Source: ABdhPJzZoc4rPSI4cPQs0F2La9EQPBT9dAU7jIlZD1eLjgIyuTe0MqY08EKUFu4GFOPJw+3Q+z6gAg== X-Received: by 2002:ad4:4ab0:: with SMTP id i16mr4830496qvx.1.1616615248749; Wed, 24 Mar 2021 12:47:28 -0700 (PDT) Received: from [192.168.1.132] ([177.194.41.149]) by smtp.gmail.com with ESMTPSA id t24sm2120890qto.23.2021.03.24.12.47.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Mar 2021 12:47:28 -0700 (PDT) Subject: Re: [PATCH] tst: Provide test for select To: "H.J. Lu" , Lukasz Majewski Cc: GNU C Library References: <20210314164625.9312-1-lukma@denx.de> <20210322123213.58775fbd@jawa> From: Adhemerval Zanella Message-ID: <39ac5960-73ef-f838-4409-20384c83b59d@linaro.org> Date: Wed, 24 Mar 2021 16:47:26 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 19:47:30 -0000 On 24/03/2021 16:17, H.J. Lu wrote: > On Mon, Mar 22, 2021 at 4:33 AM Lukasz Majewski wrote: >> >> Dear Community, >> >>> This change adds new test to assess select()'s timeout related >>> functionality (the rdfs set provides valid fd - stderr - but during >>> normal program operation there is no data to be read, so one just >>> waits for timeout). >>> >>> To be more specific - two use cases are checked: >>> - if select() times out immediately when passed struct timeval has >>> zero values of tv_usec and tv_sec. >>> - if select() times out after timeout specified in passed argument >> >> Do you have any comments regarding this patch? >> > > This test failed on machines with more than 40 cores: > > tst-select.c:54: 1616610088.851713938s not after 1616610089.851712804s > (difference 0.999998866s) > error: 1 test failures > > I was doing 3 "makec -j28 check" in parallel. I think the nanosecond precision of time accounting is triggering the failure, since select only support timeval (the error indicates that the nanosecond precision is what is triggering it). Maybe if we ignore the nanosecond precision: diff --git a/misc/tst-select.c b/misc/tst-select.c index 7c310256c5..4b1791ac8a 100644 --- a/misc/tst-select.c +++ b/misc/tst-select.c @@ -45,6 +45,8 @@ test_select_timeout (bool zero_tmo) to.tv_sec = timeout; ts = xclock_now (CLOCK_REALTIME); ts = timespec_add (ts, (struct timespec) { timeout, 0 }); + /* Ignore nanosecond precision since select only support microsecond. */ + ts.tv_nsec = (ts.tv_nsec * 1000) / 1000; /* Wait for timeout. */ int ret = select (fds + 1, &rfds, NULL, NULL, &to);