File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 7
7
8
8
from test import support
9
9
from test .support import import_helper
10
+ from test .support import threading_helper
10
11
_interpreters = import_helper .import_module ('_xxsubinterpreters' )
11
12
_channels = import_helper .import_module ('_xxinterpchannels' )
12
13
from test .support import interpreters
@@ -463,6 +464,27 @@ def test_bytes_for_script(self):
463
464
# test_xxsubinterpreters covers the remaining Interpreter.run() behavior.
464
465
465
466
467
+ class StressTests (TestBase ):
468
+
469
+ # In these tests we generally want a lot of interpreters,
470
+ # but not so many that any test takes too long.
471
+
472
+ def test_create_many_sequential (self ):
473
+ alive = []
474
+ for _ in range (100 ):
475
+ interp = interpreters .create ()
476
+ alive .append (interp )
477
+
478
+ def test_create_many_threaded (self ):
479
+ alive = []
480
+ def task ():
481
+ interp = interpreters .create ()
482
+ alive .append (interp )
483
+ threads = (threading .Thread (target = task ) for _ in range (200 ))
484
+ with threading_helper .start_threads (threads ):
485
+ pass
486
+
487
+
466
488
class TestIsShareable (TestBase ):
467
489
468
490
def test_default_shareables (self ):
2D41
You can’t perform that action at this time.
0 commit comments