Skip to content

Commit c4d1812

Browse files
committed
[runtests] Error out early if tracd is non-responsive
1 parent a0e1357 commit c4d1812

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

runtests.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,13 +240,17 @@ def startTracd(cls, **kwargs):
240240
kwargs['stderr'] = sys.stderr
241241
cls.tracd = subprocess.Popen(tracd + ['--port', '8765', '--auth=*,%s,realm' % d(HTDIGEST), d(ENV)], **kwargs)
242242

243-
while True:
243+
waittime = 0.1
244+
for _ in range(5):
244245
try:
245246
urllib2.urlopen(URL)
246247
except urllib2.URLError:
247-
time.sleep(0.1)
248+
time.sleep(waittime)
249+
waittime *= 2
248250
else:
249251
break
252+
else:
253+
raise RuntimeError("Can't communicate with tracd running on port 8765")
250254

251255
@classmethod
252256
def stopTracd(cls):

0 commit comments

Comments
 (0)