Mercurial > public > mercurial-scm > hg
diff tests/test-worker.t @ 32043:b844d0d367e2
worker: print traceback for uncaught exception unconditionally
This is what a Python interpreter would do if there were no os._exit().
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 15 Apr 2017 13:04:55 +0900 |
parents | 8f8ad0139b8b |
children | 6e0368b6e0bb |
line wrap: on
line diff
--- a/tests/test-worker.t Sat Apr 15 13:27:44 2017 +0900 +++ b/tests/test-worker.t Sat Apr 15 13:04:55 2017 +0900 @@ -13,12 +13,18 @@ > # by first worker for test stability > raise error.Abort('known exception') > return runme(ui, []) + > def exc(ui, args): + > if args[0] == 0: + > # by first worker for test stability + > raise Exception('unknown exception') + > return runme(ui, []) > def runme(ui, args): > for arg in args: > ui.status('run\n') > yield 1, arg > functable = { > 'abort': abort, + > 'exc': exc, > 'runme': runme, > } > cmdtable = {} @@ -76,3 +82,9 @@ > test 100000.0 abort --traceback 2>&1 | grep '^Traceback' Traceback (most recent call last): Traceback (most recent call last): + +Traceback must be printed for unknown exceptions + + $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=2' \ + > test 100000.0 exc 2>&1 | grep '^Traceback' + Traceback (most recent call last):