[3.13] gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299) (GH-127323)

(cherry picked from commit 83926d3b4c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-11-30 10:19:13 +01:00 committed by GitHub
parent d2d1055129
commit 82d199d307
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1196,11 +1196,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'')