Commit 6f97fae5 authored by Tim Peters's avatar Tim Peters

Merge rev 29879 from 3.4 branch.

Port from 3.3 branch.

Port from Zope 2.7 branch.

The various flavors of the ``check2ZODBThreads`` and ``check7ZODBThreads``
tests are much less likely to suffer sproadic failures now.
parent 6a317f58
...@@ -3,6 +3,17 @@ What's new in ZODB3 3.5a0? ...@@ -3,6 +3,17 @@ What's new in ZODB3 3.5a0?
Release date: DD-MMM-YYYY Release date: DD-MMM-YYYY
What's new in ZODB3 3.4xx?
==========================
Release date: MM-DDD-2005
Tests
-----
The various flavors of the ``check2ZODBThreads`` and ``check7ZODBThreads``
tests are much less likely to suffer sproadic failures now.
What's new in ZODB3 3.4a2? What's new in ZODB3 3.4a2?
========================== ==========================
Release date: 03-Apr-2005 Release date: 03-Apr-2005
...@@ -137,6 +148,17 @@ were added. ``fsIndex`` is a special hybrid kind of BTree used to implement ...@@ -137,6 +148,17 @@ were added. ``fsIndex`` is a special hybrid kind of BTree used to implement
FileStorage indices. Thanks to Chris McDonough for code and tests. FileStorage indices. Thanks to Chris McDonough for code and tests.
What's new in ZODB3 3.3.1?
==========================
Release date: DD-MMM-2005
Tests
-----
The various flavors of the ``check2ZODBThreads`` and ``check7ZODBThreads``
tests are much less likely to suffer sproadic failures now.
What's new in ZODB3 3.3.1c1? What's new in ZODB3 3.3.1c1?
============================ ============================
Release date: 01-Apr-2005 Release date: 01-Apr-2005
......
...@@ -75,23 +75,33 @@ class ZODBClientThread(TestThread): ...@@ -75,23 +75,33 @@ class ZODBClientThread(TestThread):
transaction.commit() transaction.commit()
time.sleep(self.delay) time.sleep(self.delay)
# Return a new PersistentMapping, and store it on the root object under
# the name (.getName()) of the current thread.
def get_thread_dict(self, root): def get_thread_dict(self, root):
# This is vicious: multiple threads are slamming changes into the
# root object, then trying to read the root object, simultaneously
# and without any coordination. Conflict errors are rampant. It
# used to go around at most 10 times, but that fairly often failed
# to make progress in the 7-thread tests on some test boxes. Going
# around (at most) 1000 times was enough so that a 100-thread test
# reliably passed on Tim's hyperthreaded WinXP box (but at the
# original 10 retries, the same test reliably failed with 15 threads).
name = self.getName() name = self.getName()
# arbitrarily limit to 10 re-tries MAXRETRIES = 1000
for i in range(10):
for i in range(MAXRETRIES):
try: try:
m = PersistentMapping() root[name] = PersistentMapping()
root[name] = m
transaction.commit() transaction.commit()
break break
except ConflictError, err: except ConflictError:
transaction.abort()
root._p_jar.sync() root._p_jar.sync()
for i in range(10):
for i in range(MAXRETRIES):
try: try:
return root.get(name) return root.get(name)
except ConflictError: except ConflictError:
transaction.abort() root._p_jar.sync()
class StorageClientThread(TestThread): class StorageClientThread(TestThread):
......
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