Skip to content

Commit a731e8c

Browse files
test: update test based on review
1 parent 7b2bd13 commit a731e8c

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lib/test/test_bytes.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2908,6 +2908,9 @@ def check(funcs, it):
29082908
check([iter_next] + [iter_reduce] * 10, iter(ba)) # for tsan
29092909
check([iter_next] + [iter_setstate] * 10, iter(ba)) # for tsan
29102910

2911+
@unittest.skipUnless(support.Py_GIL_DISABLED, 'this test can only possibly fail with GIL disabled')
2912+
@threading_helper.reap_threads
2913+
@threading_helper.requires_working_threading()
29112914
def test_free_threading_bytearray_resize(self):
29122915
def resize_stress(ba):
29132916
for _ in range(100_000):
@@ -2919,8 +2922,8 @@ def resize_stress(ba):
29192922

29202923
ba = bytearray(100)
29212924
threads = [threading.Thread(target=resize_stress, args=(ba,)) for _ in range(4)]
2922-
for t in threads: t.start()
2923-
for t in threads: t.join()
2925+
with threading_helper.start_threads(threads):
2926+
pass
29242927

29252928
if __name__ == "__main__":
29262929
unittest.main()

0 commit comments

Comments
 (0)