mirror of
https://github.com/openglow-org/forgefirm.git
synced 2026-09-29 01:21:16 -07:00
bench: surface the controller stderr when the harness cannot connect
A startup failure previously reported only cannot-connect with the process stderr discarded - undiagnosable in CI.
This commit is contained in:
@@ -151,7 +151,11 @@ class Session:
|
|||||||
return s
|
return s
|
||||||
except OSError:
|
except OSError:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
fail("[%s] cannot connect to the controller" % self.name)
|
err = b""
|
||||||
|
if self.proc.poll() is not None:
|
||||||
|
err = self.proc.stderr.read() or b""
|
||||||
|
fail("[%s] cannot connect to the controller (exit=%s)\n%s"
|
||||||
|
% (self.name, self.proc.poll(), err.decode(errors="replace")))
|
||||||
|
|
||||||
def armed_count(self):
|
def armed_count(self):
|
||||||
return "".join(self.log).count(ARMED)
|
return "".join(self.log).count(ARMED)
|
||||||
|
|||||||
@@ -167,7 +167,11 @@ def run_session(name, steps):
|
|||||||
except OSError:
|
except OSError:
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
if sock is None:
|
if sock is None:
|
||||||
fail("[%s] cannot connect to the controller" % name)
|
err = b""
|
||||||
|
if proc.poll() is not None:
|
||||||
|
err = proc.stderr.read() or b""
|
||||||
|
fail("[%s] cannot connect to the controller (exit=%s)\n%s"
|
||||||
|
% (name, proc.poll(), err.decode(errors="replace")))
|
||||||
|
|
||||||
log = []
|
log = []
|
||||||
read_avail(sock, log, 0.5) # banner / hello
|
read_avail(sock, log, 0.5) # banner / hello
|
||||||
|
|||||||
Reference in New Issue
Block a user