gh-109746: Fix race condition in test_start_new_thread_failed (GH-127299)

This commit is contained in:
Serhiy Storchaka 2024-11-27 13:29:50 +02:00 committed by GitHub
parent 6d3b5206cf
commit 83926d3b4c
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'')