[ovs-dev] [PATCH] ovsdb-cluster.at: Fix infinite loop in torture tests.

Ilya Maximets i.maximets at ovn.org
Thu Nov 26 10:17:29 UTC 2020


For some reason, while running cluster torture tests in GitHub Actions
workflow, failure of 'echo' command doesn't fail the loop and subshell
never exits, but keeps infinitely printing errors after breaking from
the loop on the right side of the pipeline:

  testsuite: line 8591: echo: write error: Broken pipe

Presumably, that is caused by some shell configuration option, but
I have no idea which one and I'm not able to reproduce locally with
shell configuration options provided in GitHub documentation.
Let's just add an explicit 'exit' on 'echo' failure.  This will
guarantee exit from the loop and the subshell regardless of
configuration.

CC: Ben Pfaff <blp at ovn.org>
Fixes: 0f03ae3754ec ("ovsdb: Improve timing in cluster torture test.")
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
---

GHA shell configuration:
https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#using-a-specific-shell

 tests/ovsdb-cluster.at | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ovsdb-cluster.at b/tests/ovsdb-cluster.at
index e0758e954..92aa42709 100644
--- a/tests/ovsdb-cluster.at
+++ b/tests/ovsdb-cluster.at
@@ -701,7 +701,7 @@ ovsdb|WARN|schema: changed 30 columns in 'Open_vSwitch' database from ephemeral
     # Use file instead of var because code inside "while" runs in a subshell.
     echo 0 > phase
     i=0
-    (while :; do echo; sleep 0.1; done) | while read REPLY; do
+    (while :; do echo || exit 0; sleep 0.1; done) | while read REPLY; do
         printf "t=%2d s:" $i
         done=0
         for j in $(seq 0 $(expr $n1 - 1)); do
-- 
2.25.4



More information about the dev mailing list