Decrease sleep time to 0.1s.
authorRichard Xia <rxia@sifive.com>
Thu, 10 Nov 2016 22:24:08 +0000 (14:24 -0800)
committerRichard Xia <rxia@sifive.com>
Thu, 10 Nov 2016 22:24:08 +0000 (14:24 -0800)
debug/testlib.py

index 40daad56d93f169b590c70e54ff7b3df7c7a8b34..b8e9ad4d209c47e41865e4aab933ab6d99d90504 100644 (file)
@@ -161,7 +161,7 @@ class Openocd(object):
 
     def _get_gdb_server_port(self):
         """Get port that OpenOCD's gdb server is listening on."""
-        MAX_ATTEMPTS = 5
+        MAX_ATTEMPTS = 50
         PORT_REGEX = re.compile(r'(?P<port>\d+) \(LISTEN\)')
         for _ in range(MAX_ATTEMPTS):
             with open(os.devnull, 'w') as devnull:
@@ -179,7 +179,7 @@ class Openocd(object):
             elif matches:
                 [match] = matches
                 return int(match.group('port'))
-            time.sleep(1)
+            time.sleep(0.1)
         raise Exception("Timed out waiting for gdb server to obtain port.")
 
     def __del__(self):