[3.12] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299) (GH-127324)

(cherry picked from commit 83926d3b4c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-11-27 13:22:32 +01:00 committed by GitHub
parent 16e899d589
commit 97ed21636c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1175,11 +1175,11 @@ class ThreadTests(BaseTestCase):
except RuntimeError:
print('ok')
else:
print('skip')
print('!skip!')
"""
_, out, err = assert_python_ok("-u", "-c", code)
out = out.strip()
if out == b'skip':
if b'!skip!' in out:
self.skipTest('RLIMIT_NPROC had no effect; probably superuser')
self.assertEqual(out, b'ok')
self.assertEqual(err, b'')