https://github.com/python/cpython/commit/5615351a4be87c4b1cccb7d06bc341a12e113fa8
commit: 5615351a4be87c4b1cccb7d06bc341a12e113fa8
branch: 3.13
author: Victor Stinner <[email protected]>
committer: Yhg1s <[email protected]>
date: 2024-09-24T11:26:02-07:00
summary:

[3.13] gh-124402: Require cpu resource in test_free_threading (#124438) 
(#124439)

gh-124402: Require cpu resource in test_free_threading (#124438)

Require the 'cpu' test resource on slow test_free_threading tests.

(cherry picked from commit 38a5beb12a64461a06b84fab285944ecb66de04c)

files:
M Lib/test/test_free_threading/test_list.py
M Lib/test/test_free_threading/test_monitoring.py
M Lib/test/test_free_threading/test_type.py

diff --git a/Lib/test/test_free_threading/test_list.py 
b/Lib/test/test_free_threading/test_list.py
index 6ad806d67a80ed..c6b58fcd86f449 100644
--- a/Lib/test/test_free_threading/test_list.py
+++ b/Lib/test/test_free_threading/test_list.py
@@ -3,6 +3,7 @@
 from threading import Thread
 from unittest import TestCase
 
+from test import support
 from test.support import threading_helper
 
 
@@ -13,6 +14,7 @@ def __init__(self, v):
 
 @threading_helper.requires_working_threading()
 class TestList(TestCase):
+    @support.requires_resource('cpu')
     def test_racing_iter_append(self):
 
         l = []
@@ -42,6 +44,7 @@ def reader_func():
         for reader in readers:
             reader.join()
 
+    @support.requires_resource('cpu')
     def test_racing_iter_extend(self):
         iters = [
             lambda x: [x],
diff --git a/Lib/test/test_free_threading/test_monitoring.py 
b/Lib/test/test_free_threading/test_monitoring.py
index 3a3f1ba3b605d6..14a14fdebf1f19 100644
--- a/Lib/test/test_free_threading/test_monitoring.py
+++ b/Lib/test/test_free_threading/test_monitoring.py
@@ -7,6 +7,7 @@
 import weakref
 
 from sys import monitoring
+from test import support
 from test.support import threading_helper
 from threading import Thread, _PyRLock
 from unittest import TestCase
@@ -43,6 +44,7 @@ def after_test(self):
         """Runs once after the test is done"""
         pass
 
+    @support.requires_resource('cpu')
     def test_instrumentation(self):
         # Setup a bunch of functions which will need instrumentation...
         funcs = []
@@ -218,6 +220,7 @@ def test_register_callback(self):
         for ref in self.refs:
             self.assertEqual(ref(), None)
 
+    @support.requires_resource('cpu')
     def test_set_local_trace_opcodes(self):
         def trace(frame, event, arg):
             frame.f_trace_opcodes = True
diff --git a/Lib/test/test_free_threading/test_type.py 
b/Lib/test/test_free_threading/test_type.py
index 29ca929994cb79..45b913afd38fc9 100644
--- a/Lib/test/test_free_threading/test_type.py
+++ b/Lib/test/test_free_threading/test_type.py
@@ -5,6 +5,7 @@
 from threading import Thread
 from unittest import TestCase
 
+from test import support
 from test.support import threading_helper, import_helper
 
 
@@ -96,6 +97,7 @@ def reader_func():
 
         self.run_one(writer_func, reader_func)
 
+    @support.requires_resource('cpu')
     def test___class___modification(self):
         class Foo:
             pass

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to