[PATCH] openbsc[master]: vty tests: attempt to get at sporadic 'Broken Pipe' error

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Thu Jan 26 22:05:09 UTC 2017


Review at  https://gerrit.osmocom.org/1693

vty tests: attempt to get at sporadic 'Broken Pipe' error

Add verbose logging as well as three retries around the place that often
fails on our build server with a 'Broken Pipe' error.

Change-Id: I8851b76b2d7b87dd500ae40f47e6bea716ef3fc4
---
M openbsc/tests/vty_test_runner.py
1 file changed, 14 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/93/1693/1

diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py
index 89b7a19..dd60859 100644
--- a/openbsc/tests/vty_test_runner.py
+++ b/openbsc/tests/vty_test_runner.py
@@ -1257,7 +1257,20 @@
 def ipa_handle_resp(x, tk, verbose = False):
     s = data2str(x.recv(38))
     if "0023fe040108010701020103010401050101010011" in s:
-        x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8'))))
+        retries = 3
+        while True:
+            print "\tsending IPA identity at", time.strftime("%T")
+            try:
+                x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8'))))
+                print "\tdone sending IPA identity at", time.strftime("%T")
+                break
+            except:
+                print "\tfailed sending IPA identity at", time.strftime("%T")
+                if retries < 1:
+                    print "\tgiving up"
+                    raise
+                print "\tretrying (%d attempts left)" % retries
+                retries -= 1
     else:
         if (verbose):
             print "\tBSC <- NAT: ", s

-- 
To view, visit https://gerrit.osmocom.org/1693
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8851b76b2d7b87dd500ae40f47e6bea716ef3fc4
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>


More information about the gerrit-log mailing list