hg: run-tests: treat a parse error as return code 1

Summary:
previously, unexpected output would cause the harness to
stack trace and not show the actual test failure.

This catches the error and treats it as a failed run, which causes
the test output to be displayed.

No more `ValueError: invalid literal for int() with base 10: '0\xe2\x90\x8a'`

Reviewed By: DurhamG

Differential Revision: D13995000

fbshipit-source-id: 5c1a9e8d6f8e81a924cdbf760fa75cdc0d33b74d
This commit is contained in:
Wez Furlong 2019-02-07 18:53:41 -08:00 committed by Facebook Github Bot
parent 9efa79ce5c
commit 45a59ef1d4

View File

@ -2000,7 +2000,10 @@ class TTest(Test):
if lcmd:
# Add on last return code.
ret = int(lcmd.split()[1])
try:
ret = int(lcmd.split()[1])
except ValueError:
ret = 1
if ret != 0:
postout.append(b" [%d]\n" % ret)
if pos in after: