8000 gh-133454: Mark tests with many threads that use much memory as bigme… · python/cpython@26839ea · GitHub
[go: up one dir, main page]

Skip to content

Commit 26839ea

Browse files
gh-133454: Mark tests with many threads that use much memory as bigmem (GH-133456)
1 parent dcf93c4 commit 26839ea

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

Lib/test/test_asyncio/test_ssl.py

Lines changed: 6 additions & 4 deletions
8000
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,10 @@ async def wait_closed(self, obj):
195195
except (BrokenPipeError, ConnectionError):
196196
pass
197197

198-
def test_create_server_ssl_1(self):
198+
@support.bigmemtest(size=25, memuse=90*2**20, dry_run=False)
199+
def test_create_server_ssl_1(self, size):
199200
CNT = 0 # number of clients that were successful
200-
TOTAL_CNT = 25 # total number of clients that test will create
201+
TOTAL_CNT = size # total number of clients that test will create
201202
TIMEOUT = support.LONG_TIMEOUT # timeout for this test
202203

203204
A_DATA = b'A' * 1024 * BUF_MULTIPLIER
@@ -1038,9 +1039,10 @@ async def run_main():
10381039

10391040
self.loop.run_until_complete(run_main())
10401041

1041-
def test_create_server_ssl_over_ssl(self):
1042+
@support.bigmemtest(size=25, memuse=90*2**20, dry_run=False)
1043+
def test_create_server_ssl_over_ssl(self, size):
10421044
CNT = 0 # number of clients that were successful
1043-
TOTAL_CNT = 25 # total number of clients that test will create
1045+
TOTAL_CNT = size # total number of clients that test will create
10441046
TIMEOUT = support.LONG_TIMEOUT # timeout for this test
10451047

10461048
A_DATA = b'A' * 1024 * BUF_MULTIPLIER

Lib/test/test_importlib/test_threaded_import.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ def check_parallel_module_init(self, mock_os):
135135
if verbose:
136136
print("OK.")
137137

138-
def test_parallel_module_init(self):
138+
@support.bigmemtest(size=50, memuse=76*2**20, dry_run=False)
139+
def test_parallel_module_init(self, size):
139140
self.check_parallel_module_init()
140141

141-
def test_parallel_meta_path(self):
142+
@support.bigmemtest(size=50, memuse=76*2**20, dry_run=False)
143+
def test_parallel_meta_path(self, size):
142144
finder = Finder()
143145
sys.meta_path.insert(0, finder)
144146
try:
@@ -148,7 +150,8 @@ def test_parallel_meta_path(self):
148150
finally:
149151
sys.meta_path.remove(finder)
150152

151-
def test_parallel_path_hooks(self):
153+
@support.bigmemtest(size=50, memuse=76*2**20, dry_run=False)
154+
def test_parallel_path_hooks(self, size):
152155
# Here the Finder instance is only used to check concurrent calls
153156
# to path_hook().
154157
finder = Finder()
@@ -242,13 +245,15 @@ def target():
242245
__import__(TESTFN)
243246
del sys.modules[TESTFN]
244247

245-
def test_concurrent_futures_circular_import(self):
248+
@support.bigmemtest(size=1, memuse=1.8*2**30, dry_run=False)
249+
def test_concurrent_futures_circular_import(self, size):
246250
# Regression test for bpo-43515
247251
fn = os.path.join(os.path.dirname(__file__),
248252
'partial', 'c 8000 fimport.py')
249253
script_helper.assert_python_ok(fn)
250254

251-
def test_multiprocessing_pool_circular_import(self):
255+
@support.bigmemtest(size=1, memuse=1.8*2**30, dry_run=False)
256+
def test_multiprocessing_pool_circular_import(self, size):
252257
# Regression test for bpo-41567
253258
fn = os.path.join(os.path.dirname(__file__),
254259
'partial', 'pool_in_threads.py')

Lib/test/test_threadedtempfile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import tempfile
1717

18+
from test import support
1819
from test.support import threading_helper
1920
import unittest
2021
import io
@@ -49,7 +50,8 @@ def run(self):
4950

5051

5152
class ThreadedTempFileTest(unittest.TestCase):
52-
def test_main(self):
53+
@support.bigmemtest(size=NUM_THREADS, memuse=60*2**20, dry_run=False)
54+
def test_main(self, size):
5355
threads = [TempFileGreedy() for i in range(NUM_THREADS)]
5456
with threading_helper.start_threads(threads, startEvent.set):
5557
pass

Lib/test/test_threading.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,8 @@ def test_enumerate_after_join(self):
530530
finally:
531531
sys.setswitchinterval(old_interval)
532532

533-
def test_join_from_multiple_threads(self):
533+
@support.bigmemtest(size=20, memuse=72*2**20, dry_run=False)
534+
def test_join_from_multiple_threads(self, size):
534535
# Thread.join() should be thread-safe
535536
errors = []
536537

@@ -1431,7 +1432,8 @@ def worker():
14311432
self._run_and_join(script)
14321433

14331434
@unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug")
1434-
def test_4_daemon_threads(self):
1435+
@support.bigmemtest(size=40, memuse=70*2**20, dry_run=False)
1436+
def test_4_daemon_threads(self, size):
14351437
# Check that a daemon thread cannot crash the interpreter on shutdown
14361438
# by manipulating internal structures that are being disposed of in
14371439
# the main thread.

0 commit comments

Comments
 (0)
0