Visitar URL original
gh-161769: Use standard long timeouts for concurrent regression · StableKite/cpython@920a86d · GitHub
Skip to content

Commit 920a86d

Browse files
committed
pythongh-161769: Use standard long timeouts for concurrent regression
Actual upstream TSanFT reached the new hard30second worker-join timeout before the scanners finished. Use test.support.LONG_TIMEOUT as recommended for slow/instrumented buildbots. Keep all scan/GC workload and assertions. Re-prove the identical adjusted test on both current3.15 andmain native release FT cores: actual BlockingIOError before, PASS after unchanged errno fix. Original failing CI log and native loaded-library hashes are retained.
1 parent 87ad37c commit 920a86d

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎Lib/test/test_free_threading/test_os.py‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def _directory_scan_during_gc(directory, names):
1717
import os
1818
import threading
1919
import time
20+
from test import support
2021

2122
expected = set(names)
2223
barrier = threading.Barrier(5)
@@ -25,13 +26,13 @@ def _directory_scan_during_gc(directory, names):
2526
collections = []
2627

2728
def collect():
28-
barrier.wait(timeout=15)
29+
barrier.wait(timeout=support.LONG_TIMEOUT)
2930
while not stop.is_set() and len(collections) < 512:
3031
collections.append(gc.collect())
3132
time.sleep(0.0001)
3233

3334
def scan():
34-
barrier.wait(timeout=15)
35+
barrier.wait(timeout=support.LONG_TIMEOUT)
3536
for _ in range(256):
3637
try:
3738
assert set(os.listdir(directory)) == expected
@@ -53,10 +54,10 @@ def scan():
5354
worker.start()
5455
try:
5556
for worker in workers:
56-
worker.join(timeout=30)
57+
worker.join(timeout=support.LONG_TIMEOUT)
5758
finally:
5859
stop.set()
59-
collector.join(timeout=15)
60+
collector.join(timeout=support.LONG_TIMEOUT)
6061
assert not collector.is_alive()
6162
assert all(not worker.is_alive() for worker in workers)
6263
assert collections
@@ -67,6 +68,7 @@ def scan():
6768
class TestOs(unittest.TestCase):
6869
def test_directory_io_during_subinterpreter_gc(self):
6970
from concurrent import interpreters
71+
from test import support
7072
from concurrent.futures import ThreadPoolExecutor
7173
import json
7274
from pathlib import Path
@@ -85,7 +87,7 @@ def test_directory_io_during_subinterpreter_gc(self):
8587
_directory_scan_during_gc,
8688
directory, names)
8789
for child in children]
88-
results = [future.result(timeout=90)
90+
results = [future.result(timeout=support.LONG_TIMEOUT)
8991
for future in futures]
9092
finally:
9193
for child in children:

0 commit comments

Comments
 (0)