# HG changeset patch # User Matt Harbison # Date 1519706069 18000 # Node ID 51a9f0246931bfd3f49fa88e81682701d47b8535 # Parent 432b85a46717b6852b4550e210c72b21a67012ec 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. diff -r 432b85a46717 -r 51a9f0246931 tests/run-tests.py --- 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: diff -r 432b85a46717 -r 51a9f0246931 tests/test-run-tests.t --- 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]