fix threadpool test
This commit is contained in:
parent
260c4e626b
commit
51a6eaa057
1 changed files with 3 additions and 8 deletions
|
@ -15,11 +15,9 @@ class TestThreadPool:
|
|||
@pool.wrap
|
||||
def blocker():
|
||||
events.append("S")
|
||||
out = 0
|
||||
for i in range(10000000):
|
||||
if i == 3000000:
|
||||
time.sleep(0.001)
|
||||
events.append("M")
|
||||
out += 1
|
||||
time.sleep(0.001)
|
||||
events.append("D")
|
||||
return out
|
||||
|
||||
|
@ -30,9 +28,6 @@ class TestThreadPool:
|
|||
|
||||
assert events == ["S"] * 3 + ["M"] * 3 + ["D"] * 3
|
||||
|
||||
res = blocker()
|
||||
assert res == 10000000
|
||||
|
||||
def testLockBlockingSameThread(self):
|
||||
lock = ThreadPool.Lock()
|
||||
|
||||
|
|
Loading…
Reference in a new issue