changeset 32113:9f0c055eebae

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.
author Jun Wu <quark@fb.com>
date Sat, 22 Apr 2017 17:00:50 -0700
parents 31763785094b
children 44a98a2ea431
files tests/test-worker.t
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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