mirror of https://github.com/python/cpython
gh-108834: regrtest --fail-rerun exits with code 5 (#108896)
When the --fail-rerun option is used and a test fails and then pass, regrtest now uses exit code 5 ("rerun) instead of 2 ("bad test").
This commit is contained in:
parent
676593859e
commit
1170d5a292
|
@ -29,9 +29,10 @@ from test.support import threading_helper
|
||||||
EXIT_TIMEOUT = 120.0
|
EXIT_TIMEOUT = 120.0
|
||||||
|
|
||||||
EXITCODE_BAD_TEST = 2
|
EXITCODE_BAD_TEST = 2
|
||||||
EXITCODE_INTERRUPTED = 130
|
|
||||||
EXITCODE_ENV_CHANGED = 3
|
EXITCODE_ENV_CHANGED = 3
|
||||||
EXITCODE_NO_TESTS_RAN = 4
|
EXITCODE_NO_TESTS_RAN = 4
|
||||||
|
EXITCODE_RERUN_FAIL = 5
|
||||||
|
EXITCODE_INTERRUPTED = 130
|
||||||
|
|
||||||
|
|
||||||
class Regrtest:
|
class Regrtest:
|
||||||
|
@ -847,7 +848,7 @@ class Regrtest:
|
||||||
elif self.no_tests_run():
|
elif self.no_tests_run():
|
||||||
exitcode = EXITCODE_NO_TESTS_RAN
|
exitcode = EXITCODE_NO_TESTS_RAN
|
||||||
elif self.rerun and self.ns.fail_rerun:
|
elif self.rerun and self.ns.fail_rerun:
|
||||||
exitcode = EXITCODE_BAD_TEST
|
exitcode = EXITCODE_RERUN_FAIL
|
||||||
return exitcode
|
return exitcode
|
||||||
|
|
||||||
def action_run_tests(self):
|
def action_run_tests(self):
|
||||||
|
|
|
@ -34,6 +34,7 @@ LOG_PREFIX = r'[0-9]+:[0-9]+:[0-9]+ (?:load avg: [0-9]+\.[0-9]{2} )?'
|
||||||
EXITCODE_BAD_TEST = 2
|
EXITCODE_BAD_TEST = 2
|
||||||
EXITCODE_ENV_CHANGED = 3
|
EXITCODE_ENV_CHANGED = 3
|
||||||
EXITCODE_NO_TESTS_RAN = 4
|
EXITCODE_NO_TESTS_RAN = 4
|
||||||
|
EXITCODE_RERUN_FAIL = 5
|
||||||
EXITCODE_INTERRUPTED = 130
|
EXITCODE_INTERRUPTED = 130
|
||||||
|
|
||||||
TEST_INTERRUPTED = textwrap.dedent("""
|
TEST_INTERRUPTED = textwrap.dedent("""
|
||||||
|
@ -1265,10 +1266,10 @@ class ArgsTestCase(BaseTestCase):
|
||||||
stats=TestStats(3, 1))
|
stats=TestStats(3, 1))
|
||||||
os_helper.unlink(marker_filename)
|
os_helper.unlink(marker_filename)
|
||||||
|
|
||||||
# with --fail-rerun, exit code EXITCODE_BAD_TEST
|
# with --fail-rerun, exit code EXITCODE_RERUN_FAIL
|
||||||
# on "FAILURE then SUCCESS" state.
|
# on "FAILURE then SUCCESS" state.
|
||||||
output = self.run_tests("--rerun", "--fail-rerun", testname,
|
output = self.run_tests("--rerun", "--fail-rerun", testname,
|
||||||
exitcode=EXITCODE_BAD_TEST)
|
exitcode=EXITCODE_RERUN_FAIL)
|
||||||
self.check_executed_tests(output, [testname],
|
self.check_executed_tests(output, [testname],
|
||||||
rerun=Rerun(testname,
|
rerun=Rerun(testname,
|
||||||
match="test_fail_once",
|
match="test_fail_once",
|
||||||
|
|
Loading…
Reference in New Issue