Commit 8e2007e6 authored by Julien Muchembled's avatar Julien Muchembled

tests: fix random failures in ReplicationTests.testCheckReplicas

parent b2a20553
......@@ -706,6 +706,7 @@ class ClientConnection(Connection):
def _connectionCompleted(self):
self.writable = super(ClientConnection, self).writable
......@@ -154,6 +154,11 @@ class SerializedEventManager(EventManager):
Serialized.pending = timeout = 0
EventManager._poll(self, timeout)
def addReader(self, conn):
EventManager.addReader(self, conn)
if type(Serialized.pending) is not frozenset:
Serialized.pending = 1
class Node(object):
......@@ -674,10 +679,13 @@ class NEOCluster(object):
def tic(force=False):
# XXX: Should we automatically switch client in slave mode if it isn't ?'tic ...')
if force:
Serialized.tic()'forced tic')
while Serialized.pending:
def getNodeState(self, node):
uuid = node.uuid
......@@ -27,7 +27,7 @@ from import TransactionManager, \
from neo.lib.connection import MTClientConnection
from neo.lib.protocol import CellStates, ClusterStates, NodeStates, Packets, \
from neo.lib.util import p64
from neo.lib.util import dump, p64
from . import NEOCluster, NEOThreadedTest, Patch, predictable_random
from neo.client.pool import CELL_CONNECTED, CELL_GOOD
......@@ -239,6 +239,8 @@ class ReplicationTests(NEOThreadedTest):
def corrupt(offset):
s0, s1, s2 = (storage_dict[cell.getUUID()]
for cell in, True))'corrupt partition %u of %s',
offset, dump(s1.uuid)), p64(corrupt_tid))
return s0.uuid
def check(expected_state, expected_count):
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