Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
23894124
Commit
23894124
authored
Apr 05, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d1082f90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
15 deletions
+13
-15
neo/tests/threaded/testReplication.py
neo/tests/threaded/testReplication.py
+13
-15
No files found.
neo/tests/threaded/testReplication.py
View file @
23894124
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment