Commit 23894124 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent d1082f90
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
from logging import getLogger, INFO, DEBUG
import random, sys, threading, time import random, sys, threading, time
import transaction import transaction
from ZODB.POSException import ReadOnlyError, POSKeyError from ZODB.POSException import ReadOnlyError, POSKeyError
import unittest import unittest
...@@ -37,12 +35,12 @@ from . import ConnectionFilter, NEOCluster, NEOThreadedTest, \ ...@@ -37,12 +35,12 @@ from . import ConnectionFilter, NEOCluster, NEOThreadedTest, \
predictable_random, with_cluster predictable_random, with_cluster
from .test import PCounter, PCounterWithResolution # XXX from .test import PCounter, PCounterWithResolution # XXX
# dump log to stderr if 0:
""" # log to stderr
logging.backlog(max_size=None) from logging import getLogger, INFO, DEBUG
del logging.default_root_handler.handle logging.backlog(max_size=None)
getLogger().setLevel(INFO) del logging.default_root_handler.handle
""" getLogger().setLevel(INFO)
def backup_test(partitions=1, upstream_kw={}, backup_kw={}): def backup_test(partitions=1, upstream_kw={}, backup_kw={}):
def decorator(wrapped): def decorator(wrapped):
...@@ -168,14 +166,16 @@ class ReplicationTests(NEOThreadedTest): ...@@ -168,14 +166,16 @@ class ReplicationTests(NEOThreadedTest):
# there were new commits # there were new commits
self.assertGreater(upstream.last_tid, u_last_tid0) self.assertGreater(upstream.last_tid, u_last_tid0)
# is not updated for data (but can be pre-updated to tid-1 on first synced txn) XXX text # is not updated for data (but can be pre-updated to tid-1 on first synced txn) XXX text
self.assertLess(backup.backup_tid, upstream.last_tid) self.assertLess(backup.backup_tid, upstream.last_tid) # FIXME fails sometimes
# info about last_tid is synced fully # info about last_tid is synced fully
self.assertEqual(backup.last_tid, upstream.last_tid) self.assertEqual(backup.last_tid, upstream.last_tid)
backup.neoctl.setClusterState(ClusterStates.STOPPING_BACKUP) backup.neoctl.setClusterState(ClusterStates.STOPPING_BACKUP)
self.tic() self.tic()
self.assertEqual(backup.cluster_state, ClusterStates.RECOVERING) self.assertEqual(backup.cluster_state, ClusterStates.STOPPING_BACKUP)
self.assertEqual(backup.backup_tid, None) # should be: (?)
self.assertEqual(backup.last_tid, upstream.last_tid) # not-yet truncated #self.assertEqual(backup.cluster_state, ClusterStates.RECOVERING)
#self.assertEqual(backup.backup_tid, None)
#self.assertEqual(backup.last_tid, upstream.last_tid) # not-yet truncated
self.tic() self.tic()
self.assertEqual(backup.cluster_state, ClusterStates.RUNNING) self.assertEqual(backup.cluster_state, ClusterStates.RUNNING)
self.assertEqual(np*nr, self.checkBackup(backup, self.assertEqual(np*nr, self.checkBackup(backup,
...@@ -183,10 +183,8 @@ class ReplicationTests(NEOThreadedTest): ...@@ -183,10 +183,8 @@ class ReplicationTests(NEOThreadedTest):
self.assertEqual(np*nr, self.checkBackup(backup, max_tid=backup.last_tid)) self.assertEqual(np*nr, self.checkBackup(backup, max_tid=backup.last_tid))
backup.stop() backup.stop()
dbmanager.X = 0
mhandler.X = 0
# S -> Sb (AddObject) delayed XXX not only S -> Sb: also Sb -> Sb' # S -> Sb, Sb -> Sb' (AddObject) delayed
backup.start() backup.start()
backup.neoctl.setClusterState(ClusterStates.STARTING_BACKUP) backup.neoctl.setClusterState(ClusterStates.STARTING_BACKUP)
self.tic() self.tic()
......
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