Bug 1506928 - [mozharness] Handle KeyboardInterrupt in ScriptMixin. r=gbrown
☠☠ backed out by f478c61c1bc9 ☠ ☠
authorHenrik Skupin <mail@hskupin.info>
Mon, 01 Apr 2019 22:23:07 +0200
changeset 469761 6ad35d665d4b843f340b7f90e4b858a74866e505
parent 469760 d37796d91a97cf1e270d4ae8322103b3f7504b74
child 469762 ab985d0cbffd4602bbbd513b8717c53879ef7933
push id112819
push userhskupin@mozilla.com
push dateWed, 17 Apr 2019 11:09:58 +0000
treeherdermozilla-inbound@98c7524647ae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgbrown
bugs1506928
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1506928 - [mozharness] Handle KeyboardInterrupt in ScriptMixin. r=gbrown Differential Revision: https://phabricator.services.mozilla.com/D25749
testing/mozharness/mozharness/base/script.py
--- a/testing/mozharness/mozharness/base/script.py
+++ b/testing/mozharness/mozharness/base/script.py
@@ -1451,16 +1451,24 @@ class ScriptMixin(PlatformMixin):
                         """Avoid losing the final lines of the log?"""
                         loop = False
                     while True:
                         line = p.stdout.readline()
                         if not line:
                             break
                         parser.add_lines(line)
                 returncode = p.returncode
+        except KeyboardInterrupt:
+            level = error_level
+            if halt_on_failure:
+                level = FATAL
+            self.log("Process interrupted by the user, killing process with pid %s" % p.pid,
+                     level=level)
+            p.kill()
+            return -1
         except OSError, e:
             level = error_level
             if halt_on_failure:
                 level = FATAL
             self.log('caught OS error %s: %s while running %s' % (e.errno,
                      e.strerror, command), level=level)
             return -1