Commit bdf6389d authored by Julien Muchembled's avatar Julien Muchembled

qa: tweak condition detecting endless tic

100 is too small for tests like testBasicStore (MySQL) and testDelayedStore.
parent 95fdc01d
......@@ -42,7 +42,7 @@ from .. import NeoTestBase, Patch, getTempDirectory, setupMySQLdb, \
BIND = IP_VERSION_FORMAT_DICT[ADDRESS_TYPE], 0
LOCAL_IP = socket.inet_pton(ADDRESS_TYPE, IP_VERSION_FORMAT_DICT[ADDRESS_TYPE])
MAX_TIC_COUNT = 100
TIC_LOOP = xrange(1000)
class LockLock(object):
......@@ -255,7 +255,7 @@ class TestSerialized(Serialized):
def poll(self, timeout):
if timeout:
for x in xrange(MAX_TIC_COUNT):
for x in TIC_LOOP:
r = self._epoll.poll(0)
if r:
return r
......@@ -578,7 +578,7 @@ class NEOCluster(object):
def _lock(blocking=True):
if blocking:
logging.info('<SimpleQueue>._lock.acquire()')
for i in xrange(MAX_TIC_COUNT):
for i in TIC_LOOP:
if lock(False):
return True
Serialized.tic(step=1, quiet=True)
......
......@@ -14,6 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import time
import unittest
from ZODB.tests.BasicStorage import BasicStorage
from ZODB.tests.StorageTestBase import StorageTestBase
......@@ -24,7 +25,11 @@ from .. import Patch, threaded
class BasicTests(ZODBTestCase, StorageTestBase, BasicStorage):
def check_checkCurrentSerialInTransaction(self):
with Patch(threaded, MAX_TIC_COUNT=100000):
x = time.time() + 10
def tic_loop():
while time.time() < x:
yield
with Patch(threaded, TIC_LOOP=tic_loop()):
super(BasicTests, self).check_checkCurrentSerialInTransaction()
if __name__ == "__main__":
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment