Mercurial > hg
comparison tests/run-tests.py @ 32622:931bb962e0eb
tests: fix run-tests when there's a bad #if in a test
That has (and still does) caused the test to be skipped, but without
this fix it was possible to exit this block of code without clearing
the output channel, which poisoned the channel list for later test
method runs. Fix this by always clearing the channel in a finally.
The test for this is somewhat unfortunate. Sadly, I couldn't get a way
to reproduce this with less than 2n+1 test cases, nor could I get it
to reproduce reliably without the sleep statements. It's also crucial
that the test with the broken #if be smaller (in terms of byte count)
than the sleeping tests, so that it runs first and would poison the
channel list prior to another test needing that entry from the list.
author | Augie Fackler <augie@google.com> |
---|---|
date | Tue, 30 May 2017 20:48:43 -0400 |
parents | c59451e11cbf |
children | 3afe258fb0fe |
comparison
equal
deleted
inserted
replaced
32621:c59451e11cbf | 32622:931bb962e0eb |
---|---|
1776 except KeyboardInterrupt: | 1776 except KeyboardInterrupt: |
1777 pass | 1777 pass |
1778 except: # re-raises | 1778 except: # re-raises |
1779 done.put(('!', test, 'run-test raised an error, see traceback')) | 1779 done.put(('!', test, 'run-test raised an error, see traceback')) |
1780 raise | 1780 raise |
1781 try: | 1781 finally: |
1782 channels[channel] = '' | 1782 try: |
1783 except IndexError: | 1783 channels[channel] = '' |
1784 pass | 1784 except IndexError: |
1785 pass | |
1785 | 1786 |
1786 def stat(): | 1787 def stat(): |
1787 count = 0 | 1788 count = 0 |
1788 while channels: | 1789 while channels: |
1789 d = '\n%03s ' % count | 1790 d = '\n%03s ' % count |