Skip to content

Commit bb98c52

Browse files
committed
reduce duration of test
1 parent b7c9d77 commit bb98c52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/test_free_threading/test_threading_iter_locked.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def __iter__(self):
1616

1717
def __next__(self):
1818
a = next(self.it)
19-
time.sleep(0)
19+
t = time.perf_counter() + 1e-6
20+
while time.perf_counter() < t:
21+
pass
2022
b = next(self.it)
2123
return a, b
2224

@@ -31,7 +33,7 @@ class iter_lockedThreading(unittest.TestCase):
3133
@threading_helper.reap_threads
3234
def test_iter_locked(self):
3335
number_of_threads = 10
34-
number_of_iterations = 10
36+
number_of_iterations = 8
3537
barrier = Barrier(number_of_threads)
3638
def work(it):
3739
while True:

0 commit comments

Comments
 (0)