Commit 7653d9df authored by Jim Fulton's avatar Jim Fulton

Wait longer for a thread to do it's work to avoid a spurious test

failure.
parent f8e75ad4
......@@ -249,7 +249,7 @@ class GenericTests(
key = '%s:%s' % (self._storage._storage, self._storage._server_addr)
self.assertEqual(self._storage.sortKey(), key)
def _do_store_in_separate_thread(self, oid, revid):
def _do_store_in_separate_thread(self, oid, revid, voted):
def do_store():
store = ZEO.ClientStorage.ClientStorage(self._storage._addr)
......@@ -270,7 +270,7 @@ class GenericTests(
thread = threading.Thread(name='T2', target=do_store)
thread.setDaemon(True)
thread.start()
thread.join(.2)
thread.join(voted and .1 or 9)
return thread
class FullGenericTests(
......
......@@ -206,13 +206,13 @@ class BasicStorage:
self._storage.tpc_finish(t)
t.commit()
def _do_store_in_separate_thread(self, oid, revid):
def _do_store_in_separate_thread(self, oid, revid, voted):
# We'll run the competing trans in a separate thread:
thread = threading.Thread(name='T2',
target=self._dostore, args=(oid,), kwargs=dict(revid=revid))
thread.setDaemon(True)
thread.start()
thread.join(.2)
thread.join(.1)
return thread
def check_checkCurrentSerialInTransaction(self):
......@@ -262,7 +262,7 @@ class BasicStorage:
self._storage.tpc_vote(t)
# We'll run the competing trans in a separate thread:
thread = self._do_store_in_separate_thread(oid, tid2)
thread = self._do_store_in_separate_thread(oid, tid2, True)
self._storage.tpc_finish(t)
thread.join(1)
......@@ -278,7 +278,7 @@ class BasicStorage:
'\0\0\0\0\0\0\0\0', 'x', '', t)
self._storage.checkCurrentSerialInTransaction(oid, tid3, t)
thread = self._do_store_in_separate_thread(oid, tid3)
thread = self._do_store_in_separate_thread(oid, tid3, False)
# There are 2 possibilities:
# 1. The store happens before this transaction completes,
......
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