aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-26 18:02:27 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-01 12:16:22 +0100
commitaa4f31e5741dd98acec73f16f6028e52f4c22d6f (patch)
tree7686d27bc7ec58217e53ce136ff12fc74da77393
parentc593ae5ec9fecd4bde823948024e4d56314a60ce (diff)
downloadbitbake-aa4f31e5741dd98acec73f16f6028e52f4c22d6f.tar.gz
knotty: Implement console 'keepalive' output
CI systems like jenkins and buildbot will timeout applications which haven't had console output in some period of time. Add 'keepalive' output to knotty which gives output every 5000s if not other output was made and tasks are still running. This reduces some problems encountered with our CI testing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/ui/knotty.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index f362c23af..4567c148c 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -234,6 +234,11 @@ class TerminalFilter(object):
else:
return "%ds" % (sec)
+ def keepAlive(self, t):
+ if not self.cuu:
+ print("Bitbake still alive (%ds)" % t)
+ sys.stdout.flush()
+
def updateFooter(self):
if not self.cuu:
return
@@ -467,11 +472,17 @@ def main(server, eventHandler, params, tf = TerminalFilter):
warnings = 0
taskfailures = []
+ printinterval = 5000
+ lastprint = time.time()
+
termfilter = tf(main, helper, console, errconsole, format, params.options.quiet)
atexit.register(termfilter.finish)
while True:
try:
+ if (lastprint + printinterval) <= time.time():
+ termfilter.keepAlive(printinterval)
+ printinterval += 5000
event = eventHandler.waitEvent(0)
if event is None:
if main.shutdown > 1:
@@ -500,6 +511,8 @@ def main(server, eventHandler, params, tf = TerminalFilter):
continue
if isinstance(event, logging.LogRecord):
+ lastprint = time.time()
+ printinterval = 5000
if event.levelno >= format.ERROR:
errors = errors + 1
return_value = 1