mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
gh-125900: Clean-up logic around immortalization in free-threading (#125901)
* Remove `@suppress_immortalization` decorator * Make suppression flag per-thread instead of per-interpreter * Suppress immortalization in `eval()` to avoid refleaks in three tests (test_datetime.test_roundtrip, test_logging.test_config8_ok, and test_random.test_after_fork). * frozenset() is constant, but not a singleton. When run multiple times, the test could fail due to constant interning.
This commit is contained in:
parent
1306f33c84
commit
332356b880
23 changed files with 36 additions and 137 deletions
|
|
@ -7,8 +7,7 @@ import sysconfig
|
|||
import time
|
||||
import trace
|
||||
|
||||
from test.support import (os_helper, MS_WINDOWS, flush_std_streams,
|
||||
suppress_immortalization)
|
||||
from test.support import os_helper, MS_WINDOWS, flush_std_streams
|
||||
|
||||
from .cmdline import _parse_args, Namespace
|
||||
from .findtests import findtests, split_test_packages, list_cases
|
||||
|
|
@ -535,10 +534,7 @@ class Regrtest:
|
|||
if self.num_workers:
|
||||
self._run_tests_mp(runtests, self.num_workers)
|
||||
else:
|
||||
# gh-117783: don't immortalize deferred objects when tracking
|
||||
# refleaks. Only relevant for the free-threaded build.
|
||||
with suppress_immortalization(runtests.hunt_refleak):
|
||||
self.run_tests_sequentially(runtests)
|
||||
self.run_tests_sequentially(runtests)
|
||||
|
||||
coverage = self.results.get_coverage_results()
|
||||
self.display_result(runtests)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue