diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -2112,33 +2112,36 @@ p.wait() return data for test in tests: - pread(bisectcmd + ['--reset']), - pread(bisectcmd + ['--bad', '.']) - pread(bisectcmd + ['--good', - self._runner.options.known_good_rev]) - # TODO: we probably need to forward more options - # that alter hg's behavior inside the tests. - opts = '' - withhg = self._runner.options.with_hg - if withhg: - opts += ' --with-hg=%s ' % shellquote(_strpath(withhg)) - rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts, - test) - data = pread(bisectcmd + ['--command', rtc]) - m = re.search( - (br'\nThe first (?Pbad|good) revision ' - br'is:\nchangeset: +\d+:(?P[a-f0-9]+)\n.*\n' - br'summary: +(?P[^\n]+)\n'), - data, (re.MULTILINE | re.DOTALL)) - if m is None: + try: + pread(bisectcmd + ['--reset']), + pread(bisectcmd + ['--bad', '.']) + pread(bisectcmd + ['--good', + self._runner.options.known_good_rev]) + # TODO: we probably need to forward more options + # that alter hg's behavior inside the tests. + opts = '' + withhg = self._runner.options.with_hg + if withhg: + opts += ' --with-hg=%s ' % shellquote(_strpath(withhg)) + rtc = '%s %s %s %s' % (sys.executable, sys.argv[0], opts, + test) + data = pread(bisectcmd + ['--command', rtc]) + m = re.search( + (br'\nThe first (?Pbad|good) revision ' + br'is:\nchangeset: +\d+:(?P[a-f0-9]+)\n.*\n' + br'summary: +(?P[^\n]+)\n'), + data, (re.MULTILINE | re.DOTALL)) + if m is None: + self.stream.writeln( + 'Failed to identify failure point for %s' % test) + continue + dat = m.groupdict() + verb = 'broken' if dat['goodbad'] == 'bad' else 'fixed' self.stream.writeln( - 'Failed to identify failure point for %s' % test) - continue - dat = m.groupdict() - verb = 'broken' if dat['goodbad'] == 'bad' else 'fixed' - self.stream.writeln( - '%s %s by %s (%s)' % ( - test, verb, dat['node'], dat['summary'])) + '%s %s by %s (%s)' % ( + test, verb, dat['node'], dat['summary'])) + finally: + pread(bisectcmd + ['--abort']) def printtimes(self, times): # iolock held by run diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t --- a/tests/test-run-tests.t +++ b/tests/test-run-tests.t @@ -1277,6 +1277,8 @@ > fail > EOF $ hg ci -m 'bad' + $ echo 'unrelated' > unrelated + $ hg ci -m 'unrelated' -A unrelated $ rt --known-good-rev=0 test-bisect.t --- $TESTTMP/anothertests/bisect/test-bisect.t @@ -1296,6 +1298,9 @@ python hash seed: * (glob) [1] + $ hg id -R ../bisect + 020d1494060d tip + $ cd .. support bisecting a separate repo @@ -1348,6 +1353,9 @@ python hash seed: * (glob) [1] + $ hg id -R ../bisect + 020d1494060d tip + $ cd .. Test a broken #if statement doesn't break run-tests threading.