mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
[3.13] gh-118846: Fix free-threading test failures when run sequentially (GH-118864) (#118927)
The free-threaded build currently immortalizes some objects once the
first thread is started. This can lead to test failures depending on the
order in which tests are run. This PR addresses those failures by
suppressing immortalization or skipping the affected tests.
(cherry picked from commit b309c8ebff
)
Co-authored-by: Sam Gross <colesbury@gmail.com>
This commit is contained in:
parent
b3074f0d5e
commit
cceb758c78
8 changed files with 35 additions and 6 deletions
|
@ -17,7 +17,7 @@ import unittest
|
|||
from datetime import date, datetime, time, timedelta, timezone
|
||||
from functools import cached_property
|
||||
|
||||
from test.support import MISSING_C_DOCSTRINGS
|
||||
from test.support import MISSING_C_DOCSTRINGS, requires_gil_enabled
|
||||
from test.test_zoneinfo import _support as test_support
|
||||
from test.test_zoneinfo._support import OS_ENV_LOCK, TZPATH_TEST_LOCK, ZoneInfoTestBase
|
||||
from test.support.import_helper import import_module, CleanImport
|
||||
|
@ -1931,6 +1931,7 @@ class ExtensionBuiltTest(unittest.TestCase):
|
|||
self.assertFalse(hasattr(c_zoneinfo.ZoneInfo, "_weak_cache"))
|
||||
self.assertTrue(hasattr(py_zoneinfo.ZoneInfo, "_weak_cache"))
|
||||
|
||||
@requires_gil_enabled("gh-117783: types may be immortalized")
|
||||
def test_gc_tracked(self):
|
||||
import gc
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue