From patchwork Wed Nov 6 16:29:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilya Maximets X-Patchwork-Id: 1190544 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ovn.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 477X7m6SKpz9sP6 for ; Thu, 7 Nov 2019 03:30:12 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 60793CCA; Wed, 6 Nov 2019 16:30:09 +0000 (UTC) X-Original-To: ovs-dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 67803C2C for ; Wed, 6 Nov 2019 16:30:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AC999196 for ; Wed, 6 Nov 2019 16:30:07 +0000 (UTC) X-Originating-IP: 90.177.210.238 Received: from localhost.localdomain (238.210.broadband10.iol.cz [90.177.210.238]) (Authenticated sender: i.maximets@ovn.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id B5DBE6000B; Wed, 6 Nov 2019 16:30:04 +0000 (UTC) From: Ilya Maximets To: ovs-dev@openvswitch.org Date: Wed, 6 Nov 2019 17:29:58 +0100 Message-Id: <20191106162958.3400-1-i.maximets@ovn.org> X-Mailer: git-send-email 2.17.1 X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Cc: Ilya Maximets Subject: [ovs-dev] [PATCH] tests: Wait up to OVS_CTL_TIMEOUT seconds. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org While running tests under valgrind, it could take more than 10 seconds for process to disappear after successful 'ovs-appctl exit' command. Same applies to some other events that tests are waiting for with OVS_WAIT macro. This makes tests to fail frequently under valgrind. Using OVS_CTL_TIMEOUT variable instead of constant 10 seconds seems reasonable to avoid this issue because it controls timeouts of all control utilities and needs to be adjusted while running under valgrind anyway. Signed-off-by: Ilya Maximets Acked-by: Aaron Conole --- tests/ovs-macros.at | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ovs-macros.at b/tests/ovs-macros.at index 8e512f4e7..0db3ef52e 100644 --- a/tests/ovs-macros.at +++ b/tests/ovs-macros.at @@ -229,9 +229,9 @@ ovs_wait () { sleep 0.1 if ovs_wait_cond; then echo "$1: wait succeeded quickly" >&AS_MESSAGE_LOG_FD; return 0; fi - # Then wait up to 10 seconds. + # Then wait up to OVS_CTL_TIMEOUT seconds. local d - for d in 1 2 3 4 5 6 7 8 9 10; do + for d in `seq 1 "$OVS_CTL_TIMEOUT"`; do sleep 1 if ovs_wait_cond; then echo "$1: wait succeeded after $d seconds" >&AS_MESSAGE_LOG_FD; return 0; fi done