comparison tests/run-tests.py @ 36461:51a9f0246931

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.
author Matt Harbison <matt_harbison@yahoo.com>
date Mon, 26 Feb 2018 23:34:29 -0500
parents 93228b2a1fc0
children 5c1cea8a3e60
comparison
equal deleted inserted replaced
36460:432b85a46717 36461:51a9f0246931
1760 os.system(b"%s %s %s" % 1760 os.system(b"%s %s %s" %
1761 (v, test.refpath, test.errpath)) 1761 (v, test.refpath, test.errpath))
1762 else: 1762 else:
1763 servefail, lines = getdiff(expected, got, 1763 servefail, lines = getdiff(expected, got,
1764 test.refpath, test.errpath) 1764 test.refpath, test.errpath)
1765 if servefail:
1766 self.stream.write(
1767 'server failed to start (HGPORT=%s)' % test._startport)
1768
1769 self.stream.write('\n') 1765 self.stream.write('\n')
1770 for line in lines: 1766 for line in lines:
1771 line = highlightdiff(line, self.color) 1767 line = highlightdiff(line, self.color)
1772 if PYTHON3: 1768 if PYTHON3:
1773 self.stream.flush() 1769 self.stream.flush()
1774 self.stream.buffer.write(line) 1770 self.stream.buffer.write(line)
1775 self.stream.buffer.flush() 1771 self.stream.buffer.flush()
1776 else: 1772 else:
1777 self.stream.write(line) 1773 self.stream.write(line)
1778 self.stream.flush() 1774 self.stream.flush()
1775
1776 if servefail:
1777 raise test.failureException(
1778 'server failed to start (HGPORT=%s)' % test._startport)
1779 1779
1780 # handle interactive prompt without releasing iolock 1780 # handle interactive prompt without releasing iolock
1781 if self._options.interactive: 1781 if self._options.interactive:
1782 if test.readrefout() != expected: 1782 if test.readrefout() != expected:
1783 self.stream.write( 1783 self.stream.write(