gh-117478: Add @support.requires_gil_enabled decorator (#117479)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
This commit is contained in:
Sam Gross 2024-04-04 14:10:46 -04:00 committed by GitHub
parent de5ca0bf71
commit 42205143f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 11 deletions

View file

@ -116,7 +116,7 @@ class ProcessPoolExecutorTest(ExecutorTest):
for _ in range(job_count):
sem.release()
@unittest.skipIf(support.Py_GIL_DISABLED, "gh-117344: test is flaky without the GIL")
@support.requires_gil_enabled("gh-117344: test is flaky without the GIL")
def test_idle_process_reuse_one(self):
executor = self.executor
assert executor._max_workers >= 4

View file

@ -41,7 +41,7 @@ class ThreadPoolExecutorTest(ThreadPoolMixin, ExecutorTest, BaseTestCase):
sem.release()
executor.shutdown(wait=True)
@unittest.skipIf(support.Py_GIL_DISABLED, "gh-117344: test is flaky without the GIL")
@support.requires_gil_enabled("gh-117344: test is flaky without the GIL")
def test_idle_thread_reuse(self):
executor = self.executor_type()
executor.submit(mul, 21, 2).result()