run-tests: resume raising an exception when a server fails to start
Prior to 93228b2a1fc0, this exception was raised before the diff could be
printed. By raising the exception after printing the diff, the location of the
failure can be identified, but it is also easier to locate test runs where this
occurs. The test bot maintains a list of failed tests, separate from the wall
of diff output.
--- a/tests/run-tests.py Tue Feb 27 14:49:05 2018 +0530
+++ b/tests/run-tests.py Mon Feb 26 23:34:29 2018 -0500
@@ -1762,10 +1762,6 @@
else:
servefail, lines = getdiff(expected, got,
test.refpath, test.errpath)
- if servefail:
- self.stream.write(
- 'server failed to start (HGPORT=%s)' % test._startport)
-
self.stream.write('\n')
for line in lines:
line = highlightdiff(line, self.color)
@@ -1777,6 +1773,10 @@
self.stream.write(line)
self.stream.flush()
+ if servefail:
+ raise test.failureException(
+ 'server failed to start (HGPORT=%s)' % test._startport)
+
# handle interactive prompt without releasing iolock
if self._options.interactive:
if test.readrefout() != expected:
--- a/tests/test-run-tests.t Tue Feb 27 14:49:05 2018 +0530
+++ b/tests/test-run-tests.t Mon Feb 26 23:34:29 2018 -0500
@@ -541,7 +541,7 @@
> $ echo 'abort: child process failed to start blah'
> EOF
$ rt test-serve-fail.t
- server failed to start (HGPORT=*) (glob)
+
--- $TESTTMP/test-serve-fail.t
+++ $TESTTMP/test-serve-fail.t.err
@@ -1* +1,2 @@ (glob)
@@ -550,7 +550,7 @@
ERROR: test-serve-fail.t output changed
!
- Failed test-serve-fail.t: output changed
+ Failed test-serve-fail.t: server failed to start (HGPORT=*) (glob)
# Ran 1 tests, 0 skipped, 1 failed.
python hash seed: * (glob)
[1]