From 51a6eaa057f07deda864355fd2bc62d19072f1a0 Mon Sep 17 00:00:00 2001 From: caryoscelus Date: Thu, 20 Jul 2023 18:28:21 +0000 Subject: [PATCH] fix threadpool test --- src/Test/TestThreadPool.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/Test/TestThreadPool.py b/src/Test/TestThreadPool.py index 5e95005ee..5e71155dd 100644 --- a/src/Test/TestThreadPool.py +++ b/src/Test/TestThreadPool.py @@ -15,11 +15,9 @@ def testExecutionOrder(self): @pool.wrap def blocker(): events.append("S") - out = 0 - for i in range(10000000): - if i == 3000000: - events.append("M") - out += 1 + time.sleep(0.001) + events.append("M") + time.sleep(0.001) events.append("D") return out @@ -30,9 +28,6 @@ def blocker(): assert events == ["S"] * 3 + ["M"] * 3 + ["D"] * 3 - res = blocker() - assert res == 10000000 - def testLockBlockingSameThread(self): lock = ThreadPool.Lock()