Better test of threadpool
This commit is contained in:
parent
66a1c4d242
commit
fa0d1a50b5
1 changed files with 3 additions and 1 deletions
|
@ -16,6 +16,8 @@ class TestThreadPool:
|
|||
events.append("S")
|
||||
out = 0
|
||||
for i in range(10000000):
|
||||
if i == 5000000:
|
||||
events.append("M")
|
||||
out += 1
|
||||
events.append("D")
|
||||
return out
|
||||
|
@ -25,7 +27,7 @@ class TestThreadPool:
|
|||
threads.append(gevent.spawn(blocker))
|
||||
gevent.joinall(threads)
|
||||
|
||||
assert events == ["S"] * 4 + ["D"] * 4
|
||||
assert events == ["S"] * 4 + ["M"] * 4 + ["D"] * 4
|
||||
|
||||
res = blocker()
|
||||
assert res == 10000000
|
||||
|
|
Loading…
Reference in a new issue