[Zodb-checkins] CVS: ZEO/ZEO/tests - CommitLockTests.py:1.1.2.5 forker.py:1.10.4.4.2.4 testZEO.py:1.16.4.4.2.8
Tim Peters
tim.one@comcast.net
Tue, 21 May 2002 18:28:57 -0400
Update of /cvs-repository/ZEO/ZEO/tests
In directory cvs.zope.org:/tmp/cvs-serv9097/ZEO/tests
Modified Files:
Tag: ZEO2-branch
CommitLockTests.py forker.py testZEO.py
Log Message:
Some Windows-specific changes.
=== ZEO/ZEO/tests/CommitLockTests.py 1.1.2.4 => 1.1.2.5 ===
# Copyright (c) 2002 Zope Corporation and Contributors.
# All Rights Reserved.
-#
+#
# This software is subject to the provisions of the Zope Public License,
# Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
# FOR A PARTICULAR PURPOSE
-#
+#
##############################################################################
"""Tests of the distributed commit lock."""
@@ -41,17 +41,17 @@
def run(self):
try:
self.storage.tpc_begin(self.trans)
+ oid = self.storage.new_oid()
+ self.storage.store(oid, ZERO, zodb_pickle(MinPO("c")), '', self.trans)
+ oid = self.storage.new_oid()
+ self.storage.store(oid, ZERO, zodb_pickle(MinPO("c")), '', self.trans)
+ self.storage.tpc_vote(self.trans)
+ if self.method == "tpc_finish":
+ self.storage.tpc_finish(self.trans)
+ else:
+ self.storage.tpc_abort(self.trans)
except Disconnected:
- return
- oid = self.storage.new_oid()
- self.storage.store(oid, ZERO, zodb_pickle(MinPO("c")), '', self.trans)
- oid = self.storage.new_oid()
- self.storage.store(oid, ZERO, zodb_pickle(MinPO("c")), '', self.trans)
- self.storage.tpc_vote(self.trans)
- if self.method == "tpc_finish":
- self.storage.tpc_finish(self.trans)
- else:
- self.storage.tpc_abort(self.trans)
+ pass
class CommitLockTests:
@@ -63,7 +63,7 @@
# other transactions before they actually block. IOW, by the time
# the other transactions get to the vote stage, the first
# transaction has finished.
-
+
def checkCommitLock1OnCommit(self):
self._storages = []
try:
=== ZEO/ZEO/tests/forker.py 1.10.4.4.2.3 => 1.10.4.4.2.4 ===
if script.endswith('.pyc'):
script = script[:-1]
- args = (sys.executable, script, str(port), storage_name) + args
+ args = (sys.executable, script, str(port), storage_name) + args[0]
d = os.environ.copy()
d['PYTHONPATH'] = os.pathsep.join(sys.path)
pid = os.spawnve(os.P_NOWAIT, sys.executable, args, d)
=== ZEO/ZEO/tests/testZEO.py 1.16.4.4.2.7 => 1.16.4.4.2.8 ===
os.waitpid(pid, 0)
self.delStorage()
+
+ def open(self, read_only=0):
+ # XXX Needed to support ReadOnlyStorage tests. Ought to be a
+ # cleaner way.
+
+ # Is this the only way to get the address?
+ addr = self._storage._rpc_mgr.addr[0][1]
+ self._storage.close()
+ self._storage = ZEO.ClientStorage.ClientStorage(addr, read_only=1,
+ wait=1)
def checkLargeUpdate(self):
obj = MinPO("X" * (10 * 128 * 1024))
@@ -111,16 +121,6 @@
self.__fs_base = tempfile.mktemp()
self.__super_setUp()
- def open(self, read_only=0):
- # XXX Needed to support ReadOnlyStorage tests. Ought to be a
- # cleaner way.
-
- # Is this the only way to get the address?
- addr = self._storage._rpc_mgr.addr[0][1]
- self._storage.close()
- self._storage = ZEO.ClientStorage.ClientStorage(addr, read_only=1,
- wait=1)
-
def getStorage(self):
self.__fs_base = tempfile.mktemp()
return 'FileStorage', (self.__fs_base, '1')
@@ -148,7 +148,7 @@
args = args[1:]
zeo_addr, self.test_addr, self.test_pid = \
forker.start_zeo_server(name, args)
- storage = ZEO.ClientStorage.ClientStorage(zeo_addr, debug=1,
+ storage = ZEO.ClientStorage.ClientStorage(zeo_addr, wait=1,#debug=1,
min_disconnect_poll=0.1)
self._storage = PackWaitWrapper(storage)
storage.registerDB(DummyDB(), None)
@@ -405,6 +405,7 @@
base = ZEO.ClientStorage.ClientStorage(self.addr,
client=cache,
cache_size=cache_size,
+ # debug=1,
wait=1)
storage = PackWaitWrapper(base)
storage.registerDB(DummyDB(), None)