Skip to content

Commit

Permalink
Better test of threadpool
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcutme committed Nov 30, 2019
1 parent 66a1c4d commit fa0d1a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Test/TestThreadPool.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ def blocker():
events.append("S")
out = 0
for i in range(10000000):
if i == 5000000:
events.append("M")
out += 1
events.append("D")
return out
Expand All @@ -25,7 +27,7 @@ def blocker():
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
Expand Down

0 comments on commit fa0d1a5

Please sign in to comment.