From patchwork Wed Jul 19 22:25:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Biggers X-Patchwork-Id: 9853301 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F42E602C8 for ; Wed, 19 Jul 2017 22:25:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E88828718 for ; Wed, 19 Jul 2017 22:25:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 439392871C; Wed, 19 Jul 2017 22:25:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCE8A28718 for ; Wed, 19 Jul 2017 22:25:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932912AbdGSWZs (ORCPT ); Wed, 19 Jul 2017 18:25:48 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:37629 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932416AbdGSWZr (ORCPT ); Wed, 19 Jul 2017 18:25:47 -0400 Received: by mail-pf0-f194.google.com with SMTP id d18so937732pfe.4 for ; Wed, 19 Jul 2017 15:25:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=+1j3y0KEGrqD2htaRs1zuIcObQPQ/bsIpwW8BfQ8Gfs=; b=gPNeWOJJE9yJMduVsvTBZ7wrQAm6L+8Xx+6wne+wGBim6EOJ7HqfW8P2CQG7C7hFeM KQ/3Xc251vQK771ENlthp4m2gMTqt7rWm66f3hdSPNX9c68LVtmcAQL2rlIIB0JwQBLr k0dks8SDSX6ABByfIQ53gpoIrJ8hk5iNJrh+XkkKIFODqv/135FJynY+sXXSM9btI7qq fDqgUwJAjk4+/dxY0UMriSaS8uK1I2waboRo9jAA69I1hZDXpD1HdRaM6yTucffzGqPY pXwYIxZId6kEyskD7N339g13y9eKhF4Eqh4+4AXgzOI5EZxSeN63X2H+liVRQg0EEqmh 4yEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+1j3y0KEGrqD2htaRs1zuIcObQPQ/bsIpwW8BfQ8Gfs=; b=JVuUTcbMpSGUorscuV87i+3MMQTqDTCXxCJpa4+rKYvXjriHy4AaMaqSGWjagAQAUJ RvZGQPm80cZ7UZeF/C7/5coKtdSL4lRhUlTZL2EApyuyhmTHXwsbS5RKqcy8aKkU6c31 PBsKAzwdn9wpp8+nsO0ztSjZ20Ha/uzlE3gSWsfcwgeJjqm/y9d8xgTaaXB+XpmVZygp y0jIfoT2bSE54y2Gud3mCqrHOC8ZM9znh39IlUBQt7SlAe8SnOz0LGfM8gYn6R3cudp0 xb/dlw1qT3Ez8xis/g/mzjB51K6OASReWACuoJK0bg8iJty7UTMH3m0CIynlruxWu2gF 5Tlg== X-Gm-Message-State: AIVw110lg7MDw67+b3F+wOoGkq0/1VDqZQ123xPbHixYuYYsKWBBm1Xu iALtyuYZMIsU5LV/rDA= X-Received: by 10.99.117.71 with SMTP id f7mr1520403pgn.245.1500503147033; Wed, 19 Jul 2017 15:25:47 -0700 (PDT) Received: from ebiggers-linuxstation.kir.corp.google.com ([100.66.174.81]) by smtp.gmail.com with ESMTPSA id g74sm1362891pfk.183.2017.07.19.15.25.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Jul 2017 15:25:46 -0700 (PDT) From: Eric Biggers To: fstests@vger.kernel.org Cc: Eric Biggers Subject: [PATCH] generic/192: use shorter sleep and tolerate 2s delay Date: Wed, 19 Jul 2017 15:25:08 -0700 Message-Id: <20170719222508.145781-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.14.0.rc0.284.gd933b75aa4-goog Sender: fstests-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: fstests@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Biggers generic/192 would sleep 40 seconds, update a file's atime, and then fail if the atime was not exactly 40 seconds later. This is unreliable since things may be slow enough to cause an extra second to elapse. "Fix" this by allowing for 2 seconds of delay. Also, while we're at it shorten the sleep to a much more reasonable 5 seconds. Signed-off-by: Eric Biggers --- tests/generic/192 | 13 +++++-------- tests/generic/192.out | 6 +++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tests/generic/192 b/tests/generic/192 index d3ed0ec0..2cee2e60 100755 --- a/tests/generic/192 +++ b/tests/generic/192 @@ -48,11 +48,7 @@ _supported_fs generic _supported_os Linux _require_test _require_atime -#delay=150 -#delay=75 -#delay=60 -#delay=45 -delay=40 +delay=5 testfile=$TEST_DIR/testfile rm -f $testfile @@ -61,7 +57,7 @@ rm -f $seqres.full echo test >$testfile time1=`_access_time $testfile | tee -a $seqres.full` -echo "sleep for $delay" +echo "sleep for $delay seconds" sleep $delay # sleep to allow time to move on for access cat $testfile time2=`_access_time $testfile | tee -a $seqres.full` @@ -73,8 +69,9 @@ time3=`_access_time $testfile | tee -a $seqres.full` delta1=`expr $time2 - $time1` delta2=`expr $time3 - $time1` -echo "delta1 - access time after sleep in-core: $delta1" -echo "delta2 - access time after sleep on-disk: $delta2" +# tolerate an atime up to 2s later than the ideal case +_within_tolerance "delta1" $delta1 $delay 0 2 -v +_within_tolerance "delta2" $delta2 $delta1 0 0 -v # success, all done status=0 diff --git a/tests/generic/192.out b/tests/generic/192.out index 7e1f6996..f3b41141 100644 --- a/tests/generic/192.out +++ b/tests/generic/192.out @@ -1,5 +1,5 @@ QA output created by 192 -sleep for 40 +sleep for 5 seconds test -delta1 - access time after sleep in-core: 40 -delta2 - access time after sleep on-disk: 40 +delta1 is in range +delta2 is in range