Fix noparallel ignoreclass test
This commit is contained in:
parent
862e19a263
commit
6254143fc6
1 changed files with 3 additions and 3 deletions
|
@ -5,6 +5,7 @@ import pytest
|
||||||
|
|
||||||
import util
|
import util
|
||||||
|
|
||||||
|
|
||||||
class ExampleClass(object):
|
class ExampleClass(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.counted = 0
|
self.counted = 0
|
||||||
|
@ -112,12 +113,11 @@ class TestNoparallel:
|
||||||
gevent.spawn(obj2.countQueue)
|
gevent.spawn(obj2.countQueue)
|
||||||
]
|
]
|
||||||
s = time.time()
|
s = time.time()
|
||||||
time.sleep(0)
|
time.sleep(0.001)
|
||||||
gevent.joinall(threads)
|
gevent.joinall(threads)
|
||||||
|
|
||||||
# Queue limited to 2 calls (every call takes counts to 5 and takes 0.05 sec)
|
# Queue limited to 2 calls (every call takes counts to 5 and takes 0.05 sec)
|
||||||
assert obj1.counted == 10
|
assert obj1.counted + obj2.counted == 10
|
||||||
assert obj2.counted == 0
|
|
||||||
|
|
||||||
taken = time.time() - s
|
taken = time.time() - s
|
||||||
assert 1.2 > taken >= 1.0 # 2 * 0.5s count = ~1s
|
assert 1.2 > taken >= 1.0 # 2 * 0.5s count = ~1s
|
||||||
|
|
Loading…
Reference in a new issue