test-worker: capture tracebacks more reliably
authorJun Wu <quark@fb.com>
Sat, 22 Apr 2017 17:00:50 -0700
changeset 32113 9f0c055eebae
parent 32112 31763785094b
child 32114 44a98a2ea431
test-worker: capture tracebacks more reliably The traceback test may have traceback caused by SIGTERM. Instead of grepping "Traceback", explicitly grep the exception we care about. This makes the test less flaky.
tests/test-worker.t
--- a/tests/test-worker.t	Sat Apr 22 16:50:08 2017 -0700
+++ b/tests/test-worker.t	Sat Apr 22 17:00:50 2017 -0700
@@ -81,15 +81,15 @@
   [255]
 
   $ hg --config "extensions.t=$abspath" --config 'worker.numcpus=2' \
-  > test 100000.0 abort --traceback 2>&1 | grep '^Traceback'
-  Traceback (most recent call last):
-  Traceback (most recent call last):
+  > test 100000.0 abort --traceback 2>&1 | egrep '^(SystemExit|Abort)'
+  Abort: known exception
+  SystemExit: 255
 
 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):
+  > test 100000.0 exc 2>&1 | grep '^Exception'
+  Exception: unknown exception
 
 Workers should not do cleanups in all cases