Commit c5913373 authored by Julien Muchembled's avatar Julien Muchembled

tests: clarify intention in testStorageFailureDuringTpcFinish

The test was relying on fact on the fact that 'c.abort()' caused an assertion
failure, which closed the connection and then raised OperationFailure.
Actually, I wanted to close the connection on master, but it's clearer this way.
parent 20b7cecd
...@@ -26,6 +26,7 @@ from ZODB import DB, POSException ...@@ -26,6 +26,7 @@ from ZODB import DB, POSException
from neo.storage.transactions import TransactionManager, \ from neo.storage.transactions import TransactionManager, \
DelayedError, ConflictError DelayedError, ConflictError
from neo.lib.connection import ConnectionClosed, MTClientConnection from neo.lib.connection import ConnectionClosed, MTClientConnection
from neo.lib.exception import OperationFailure
from neo.lib.protocol import CellStates, ClusterStates, NodeStates, Packets, \ from neo.lib.protocol import CellStates, ClusterStates, NodeStates, Packets, \
ZERO_TID ZERO_TID
from .. import expectedFailure, _ExpectedFailure, _UnexpectedSuccess, Patch from .. import expectedFailure, _ExpectedFailure, _UnexpectedSuccess, Patch
...@@ -829,8 +830,7 @@ class Test(NEOThreadedTest): ...@@ -829,8 +830,7 @@ class Test(NEOThreadedTest):
def testStorageFailureDuringTpcFinish(self): def testStorageFailureDuringTpcFinish(self):
def answerTransactionFinished(conn, packet): def answerTransactionFinished(conn, packet):
if isinstance(packet, Packets.AnswerTransactionFinished): if isinstance(packet, Packets.AnswerTransactionFinished):
c, = cluster.storage.getConnectionList(cluster.master) raise OperationFailure
c.abort()
cluster = NEOCluster() cluster = NEOCluster()
try: try:
cluster.start() cluster.start()
......
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