summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_trace.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-05-10 20:50:59 (GMT)
committerGitHub <noreply@github.com>2024-05-10 20:50:59 (GMT)
commitcceb758c788adb51ca1660e9d49410c2347feadc (patch)
tree1021c5c2a1f72b735988f614b9e7b3d545800646 /Lib/test/test_trace.py
parentb3074f0d5ec4ead75ecce10bf7b7a1459cbf892e (diff)
downloadcpython-cceb758c788adb51ca1660e9d49410c2347feadc.zip
cpython-cceb758c788adb51ca1660e9d49410c2347feadc.tar.gz
cpython-cceb758c788adb51ca1660e9d49410c2347feadc.tar.bz2
[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 b309c8ebff011f27012367b046ff92eecbdd68a5) Co-authored-by: Sam Gross <colesbury@gmail.com>
Diffstat (limited to 'Lib/test/test_trace.py')
-rw-r--r--Lib/test/test_trace.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Lib/test/test_trace.py b/Lib/test/test_trace.py
index 93966ee..7ff3fe4 100644
--- a/Lib/test/test_trace.py
+++ b/Lib/test/test_trace.py
@@ -1,7 +1,7 @@
import os
from pickle import dump
import sys
-from test.support import captured_stdout, requires_resource
+from test.support import captured_stdout, requires_resource, requires_gil_enabled
from test.support.os_helper import (TESTFN, rmtree, unlink)
from test.support.script_helper import assert_python_ok, assert_python_failure
import textwrap
@@ -301,6 +301,7 @@ class TestFuncs(unittest.TestCase):
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
'pre-existing trace function throws off measurements')
+ @requires_gil_enabled("gh-117783: immortalization of types affects traced method names")
def test_inst_method_calling(self):
obj = TracedClass(20)
self.tracer.runfunc(obj.inst_method_calling, 1)
@@ -334,6 +335,7 @@ class TestCallers(unittest.TestCase):
@unittest.skipIf(hasattr(sys, 'gettrace') and sys.gettrace(),
'pre-existing trace function throws off measurements')
+ @requires_gil_enabled("gh-117783: immortalization of types affects traced method names")
def test_loop_caller_importing(self):
self.tracer.runfunc(traced_func_importing_caller, 1)