@@ -257,7 +257,7 @@ class CIBuilder(Test):
poller = select.poll()
poller.register(p1.stdout, select.POLLIN)
poller.register(p1.stderr, select.POLLIN)
- while p1.poll() is None:
+ while True:
events = poller.poll(1000)
for fd, event in events:
if event != select.POLLIN:
@@ -266,6 +266,8 @@ class CIBuilder(Test):
self.log.info(p1.stdout.readline().rstrip())
if fd == p1.stderr.fileno():
app_log.error(p1.stderr.readline().rstrip())
+ if p1.poll() is not None:
+ break
p1.wait()
if p1.returncode:
self.fail("Bitbake failed")
@@ -533,7 +535,7 @@ class CIBuilder(Test):
databuf = bytearray(b'')
databuf_size = 1024 * 2 + len(login_prompt)
- while time.time() < timeout and p1.poll() is None:
+ while time.time() < timeout:
events = poller.poll(1000 * (timeout - time.time()))
for fd, event in events:
if event != select.POLLIN:
@@ -547,6 +549,8 @@ class CIBuilder(Test):
return 0
if fd == p1.stderr.fileno():
app_log.error(p1.stderr.readline().rstrip())
+ if p1.poll() is not None:
+ break
self.log.error("Didn't get login prompt")
return 1
If bitbake or qemu exit before we completely read their stdout/stderr, messages are lost. With this change, we read the subprocess output before terminating ourselves. Signed-off-by: Anton Mikanovich <amikan@ilbers.de> --- testsuite/cibuilder.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)