From cb777a0cc988cf8f6b3fc5e76258c33195267022 Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip.withnall@collabora.co.uk>
Date: Thu, 10 Sep 2015 11:14:23 +0100
Subject: [PATCH] traffic-control: Ignore failure from a wait command
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

There’s a race condition between killing a process and waiting for it to
terminate; since this test is run with `set -e`, this can cause the test
to fail if the process dies before `wait` is invoked. Fix that by
ignoring failure from it.

Bug: https://bugs.apertis.org/show_bug.cgi?id=327
Differential Revision: https://phabricator.apertis.org/D426
Signed-off-by: Philip Withnall <philip.withnall@collabora.co.uk>
---
 traffic-control/manual/run-tcmmd-test.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/traffic-control/manual/run-tcmmd-test.sh b/traffic-control/manual/run-tcmmd-test.sh
index 57bd7bb..e196acd 100755
--- a/traffic-control/manual/run-tcmmd-test.sh
+++ b/traffic-control/manual/run-tcmmd-test.sh
@@ -87,7 +87,7 @@ check_decent_speed() {
 
   sleep $WGET_TEST_DURATION
   kill -9 $WGET_PID
-  wait $WGET_PID
+  wait $WGET_PID || true
   sleep 0.2
   whine "Was it a decent speed (1MB/s or more) [yes/no]?"
   read v
-- 
GitLab