Skip to content

Commit

Permalink
Fix noparallel ignoreclass test
Browse files Browse the repository at this point in the history
  • Loading branch information
HelloZeroNet authored Jun 11, 2019
1 parent 862e19a commit 6254143
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Test/TestNoparallel.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import util


class ExampleClass(object):
def __init__(self):
self.counted = 0
Expand Down Expand Up @@ -112,12 +113,11 @@ def testIgnoreClass(self):
gevent.spawn(obj2.countQueue)
]
s = time.time()
time.sleep(0)
time.sleep(0.001)
gevent.joinall(threads)

# Queue limited to 2 calls (every call takes counts to 5 and takes 0.05 sec)
assert obj1.counted == 10
assert obj2.counted == 0
assert obj1.counted + obj2.counted == 10

taken = time.time() - s
assert 1.2 > taken >= 1.0 # 2 * 0.5s count = ~1s
Expand Down

0 comments on commit 6254143

Please sign in to comment.