Open Bug 991155 Opened 6 years ago Updated 6 years ago

Teach mach to respect Ctrl+C

Categories

(Testing :: Mochitest, defect)

x86
macOS
defect
Not set

Tracking

(Not tracked)

People

(Reporter: ehsan, Unassigned)

Details

See this for example:

$ ./mach mochitest-b2g-desktop docshell/
...
nsTraceRefcnt::DumpStatistics: 5 entries
TEST-INFO | leakcheck | leaked 3 Mutex (72 bytes)
TEST-INFO | leakcheck | leaked 4 nsLocalFile (768 bytes)
TEST-INFO | leakcheck | leaked 15 nsStringBuffer (120 bytes)
TEST-INFO | leakcheck | leaked 2 nsTArray_base (16 bytes)
TEST-UNEXPECTED-FAIL | leakcheck | 976 bytes leaked (Mutex, nsLocalFile, nsStringBuffer, nsTArray_base)
runtests.py | Running tests: end.
^C^C^C^C











Exception in thread Thread-13:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 504, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/media/storage/moz/src/obj-ff-dbg/_tests/testing/mochitest/runtestsb2g.py", line 243, in runMarionetteScript
    assert(marionette.wait_for_port())
AssertionError

Exception KeyboardInterrupt in <module 'threading' from '/usr/lib/python2.7/threading.pyc'> ignored
$ 

The blank space there is me pressing enter a few times and waiting for a minute or so before ./mach is killed.
mach by itself does respect ctrl-c. I'm guessing this is due to something deep inside a mach command that is swallowing Python KeyboardInterrupt exception.

Stack seems to indicate http://dxr.mozilla.org/mozilla-central/source/testing/mochitest/runtestsb2g.py#149
Component: mach → Mochitest
Product: Core → Testing
(In reply to comment #1)
> mach by itself does respect ctrl-c. I'm guessing this is due to something deep
> inside a mach command that is swallowing Python KeyboardInterrupt exception.
> 
> Stack seems to indicate
> http://dxr.mozilla.org/mozilla-central/source/testing/mochitest/runtestsb2g.py#149

Ah, that seems like an obvious mistake to me.  Shouldn't we re-throw the exception there?
You need to log in before you can comment on or make changes to this bug.