[3.12] gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) (#108798)

gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421)

Only mark tests which spend significant system or user time,
by itself or in subprocesses.
(cherry picked from commit f3ba0a74cd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2023-09-02 16:22:33 -07:00 committed by GitHub
parent 7269916cd7
commit dcaacd9066
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 57 additions and 5 deletions

View file

@ -6,6 +6,7 @@ import os
import threading
import unittest
from concurrent import futures
from test import support
from .executor import ExecutorTest, mul
from .util import BaseTestCase, ThreadPoolMixin, setup_module
@ -49,6 +50,7 @@ class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest, BaseTestCase):
executor.shutdown(wait=True)
@unittest.skipUnless(hasattr(os, 'register_at_fork'), 'need os.register_at_fork')
@support.requires_resource('cpu')
def test_hang_global_shutdown_lock(self):
# bpo-45021: _global_shutdown_lock should be reinitialized in the child
# process, otherwise it will never exit