From patchwork Tue Sep 29 18:17:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 523978 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (li376-54.members.linode.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 076CD140157 for ; Wed, 30 Sep 2015 04:17:35 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 017D71067E; Tue, 29 Sep 2015 11:17:33 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v1.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 804E110679 for ; Tue, 29 Sep 2015 11:17:31 -0700 (PDT) Received: from bar4.cudamail.com (bar2 [192.168.15.2]) by mx3v1.cudamail.com (Postfix) with ESMTP id C2B3E618C45 for ; Tue, 29 Sep 2015 12:17:30 -0600 (MDT) X-ASG-Debug-ID: 1443550649-03dc214246380f0001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar4.cudamail.com with ESMTP id j0IZ4UCZGIVgMFRn (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 29 Sep 2015 12:17:29 -0600 (MDT) X-Barracuda-Envelope-From: blp@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO mail-pa0-f48.google.com) (209.85.220.48) by mx3-pf1.cudamail.com with ESMTPS (RC4-SHA encrypted); 29 Sep 2015 18:17:29 -0000 Received-SPF: unknown (mx3-pf1.cudamail.com: Multiple SPF records returned) X-Barracuda-RBL-Trusted-Forwarder: 209.85.220.48 Received: by pacfv12 with SMTP id fv12so13251922pac.2 for ; Tue, 29 Sep 2015 11:17:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=5smM84F34w1ecH5LJZEYwo4XvQ6n81OEK7YXwkmrpwU=; b=Pyg87fm3VP4xpylUbaErUZJD/C/WNGNzSVnqxizvERGfqvYYXqm1HwnMSwYpRWjsoC 2cZZt09j1DfTU2CLaB/+xgDnxXZnoV+ZMzbTTJhSXkXK49wSUKNXGwgtIyww2DoNAguW 5RoIrxtiHV5iqvi+a5wMw8hF846SkV8svUPTs0Rvz+Xec7ltMqR58DYJ0HvnEyvYCjfb uU8tnffbxSbB+GI5rDAL0Dte5jB25z5MkelyeQAp3ZM/koIeHDPrO1eKnRQb3zA3DdfR Jo6zmfsgdmMw4lf6U3cHjD7Y8+4cfhBYC8DzRW28Ga3Llbuywib5r92Ig9VY/zUcFCs0 jWfg== X-Gm-Message-State: ALoCoQkn9wsOG2LvM3j29GjklRM1UXFhVfi8rU4RyLxKsGDaOE3cM+T6ng4IwWrKzlR25TCK3DSC X-Received: by 10.67.23.165 with SMTP id ib5mr34015676pad.26.1443550647831; Tue, 29 Sep 2015 11:17:27 -0700 (PDT) Received: from sigabrt.benpfaff.org ([208.91.2.4]) by smtp.gmail.com with ESMTPSA id vw7sm26982027pab.15.2015.09.29.11.17.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Sep 2015 11:17:26 -0700 (PDT) X-CudaMail-Envelope-Sender: blp@nicira.com X-Barracuda-Apparent-Source-IP: 208.91.2.4 From: Ben Pfaff To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-V1-928053595 X-CudaMail-DTE: 092915 X-CudaMail-Originating-IP: 209.85.220.48 Date: Tue, 29 Sep 2015 11:17:14 -0700 X-ASG-Orig-Subj: [##CM-V1-928053595##][PATCH repost 2/3] tests: Make OVS_WAIT_WHILE, OVS_WAIT_UNTIL run even faster in some cases. Message-Id: <1443550635-29312-2-git-send-email-blp@nicira.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1443550635-29312-1-git-send-email-blp@nicira.com> References: <1443550635-29312-1-git-send-email-blp@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1443550649 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH repost 2/3] tests: Make OVS_WAIT_WHILE, OVS_WAIT_UNTIL run even faster in some cases. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" Sometimes OVS_WAIT_WHILE and OVS_WAIT_UNTIL are used for conditions that tend to be true immediately but sometimes take a moment or two. This change makes such cases 0.1 seconds faster (which could add up over hundreds of tests). Signed-off-by: Ben Pfaff Acked-by: Flavio Leitner --- tests/ovs-macros.at | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at index 535d923..a585500 100644 --- a/tests/ovs-macros.at +++ b/tests/ovs-macros.at @@ -27,7 +27,10 @@ ovs_init() { } ovs_wait () { - # First try a quick sleep, so that the test completes very quickly + # First try the condition without waiting. + ovs_wait_cond && return 0 + + # Try a quick sleep, so that the test completes very quickly # in the normal case. POSIX doesn't require fractional times to # work, so this might not work. sleep 0.1