Skip to content

Commit f2242a1

Browse files
gh-141044: Allow stack_size tests to skip 256 KiB under TSan
1 parent 0f0971d commit f2242a1

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎Lib/test/test_thread.py‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,22 @@ def test_nt_and_posix_stack_size(self):
102102
"size")
103103

104104
fail_msg = "stack_size(%d) failed - should succeed"
105+
# 256 KiB may be below the sanitizer minimum (gh-141044 / TSan).
106+
tested = []
105107
for tss in (262144, 0x100000, 0):
106-
thread.stack_size(tss)
108+
try:
109+
thread.stack_size(tss)
110+
except ValueError:
111+
verbose_print("skipping stack_size(%d); below platform minimum"
112+
% tss)
113+
continue
107114
self.assertEqual(thread.stack_size(), tss, fail_msg % tss)
108115
verbose_print("successfully set stack_size(%d)" % tss)
116+
tested.append(tss)
109117

110118
for tss in (262144, 0x100000):
119+
if tss not in tested:
120+
continue
111121
verbose_print("trying stack_size = (%d)" % tss)
112122
self.next_ident = 0
113123
self.created = 0

0 commit comments

Comments
 (0)