Commit bbd591f8 authored by Julien Muchembled's avatar Julien Muchembled

client: add tests reproducing a bug affecting undoLog() and transactionLog()

parent cbb233f2
......@@ -904,6 +904,10 @@ class Application(object):
raise NEOStorageError('Transaction %r not found' % (tid, ))
return (txn_info, txn_ext)
# XXX: The following 2 methods fail when they reconnect to a storage after
# they already sent a request to a previous storage.
# See also testStorageReconnectDuringXxx
def undoLog(self, first, last, filter=None, block=0):
# XXX: undoLog is broken
if last < 0:
......
......@@ -147,3 +147,42 @@ class Test(NEOThreadedTest):
def testVerificationCommitUnfinishedTransactionsFastStartup(self):
self.testVerificationCommitUnfinishedTransactions(True)
def testStorageReconnectDuringStore(self):
cluster = NEOCluster(replicas=1)
try:
cluster.start()
t, c = cluster.getTransaction()
c.root()[0] = 'ok'
while cluster.client.cp.connection_dict:
cluster.client.cp._dropConnections()
t.commit() # store request
finally:
cluster.stop()
# The following 2 tests fail because the same queue is used for
# AskTIDs(From) requests and reconnections. The same bug affected
# history() before df47e5b1df8eabbff1383348b6b8c476bca0c328
def testStorageReconnectDuringTransactionLog(self):
cluster = NEOCluster(storage_count=2, partitions=2)
try:
cluster.start()
t, c = cluster.getTransaction()
while cluster.client.cp.connection_dict:
cluster.client.cp._dropConnections()
tid, (t1,) = cluster.client.transactionLog(
ZERO_TID, c.root()._p_serial, 10)
finally:
cluster.stop()
def testStorageReconnectDuringUndoLog(self):
cluster = NEOCluster(storage_count=2, partitions=2)
try:
cluster.start()
t, c = cluster.getTransaction()
while cluster.client.cp.connection_dict:
cluster.client.cp._dropConnections()
t1, = cluster.client.undoLog(0, 10)
finally:
cluster.stop()
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