Commit f4cbeae6 authored by Guido van Rossum's avatar Guido van Rossum

Change checkMultiStorageTransaction to make it easier to crank up all

config parameters at once.

Add (commented-out) print statements showing progress.
parent 79d0a117
...@@ -524,10 +524,12 @@ class ConnectionTests(StorageTestBase): ...@@ -524,10 +524,12 @@ class ConnectionTests(StorageTestBase):
def checkMultiStorageTransaction(self): def checkMultiStorageTransaction(self):
# Configuration parameters (larger values mean more likely deadlocks) # Configuration parameters (larger values mean more likely deadlocks)
self.nservers = 2 N = 2
self.nthreads = 2 # These don't *have* to be all the same, but it's convenient this way
self.ntrans = 2 self.nservers = N
self.nobj = 2 self.nthreads = N
self.ntrans = N
self.nobj = N
# Start extra servers # Start extra servers
for i in range(1, self.nservers): for i in range(1, self.nservers):
...@@ -582,6 +584,7 @@ class MSTThread(threading.Thread): ...@@ -582,6 +584,7 @@ class MSTThread(threading.Thread):
# Begin a transaction # Begin a transaction
t = Transaction() t = Transaction()
for c in clients: for c in clients:
#print "%s.%s.%s begin\n" % (tname, c.__name, i),
c.tpc_begin(t) c.tpc_begin(t)
for j in range(testcase.nobj): for j in range(testcase.nobj):
...@@ -590,17 +593,20 @@ class MSTThread(threading.Thread): ...@@ -590,17 +593,20 @@ class MSTThread(threading.Thread):
oid = c.new_oid() oid = c.new_oid()
c.__oids.append(oid) c.__oids.append(oid)
data = MinPO("%s.%s.t%d.o%d" % (tname, c.__name, i, j)) data = MinPO("%s.%s.t%d.o%d" % (tname, c.__name, i, j))
#print data.value
data = zodb_pickle(data) data = zodb_pickle(data)
s = c.store(oid, ZERO, data, '', t) s = c.store(oid, ZERO, data, '', t)
c.__serials.update(handle_all_serials(oid, s)) c.__serials.update(handle_all_serials(oid, s))
# Vote on all servers and handle serials # Vote on all servers and handle serials
for c in clients: for c in clients:
#print "%s.%s.%s vote\n" % (tname, c.__name, i),
s = c.tpc_vote(t) s = c.tpc_vote(t)
c.__serials.update(handle_all_serials(None, s)) c.__serials.update(handle_all_serials(None, s))
# Finish on all servers # Finish on all servers
for c in clients: for c in clients:
#print "%s.%s.%s finish\n" % (tname, c.__name, i),
c.tpc_finish(t) c.tpc_finish(t)
for c in clients: for c in clients:
......
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