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
ab552d87
Commit
ab552d87
authored
Nov 10, 2016
by
Kirill Smelkov
Committed by
Julien Muchembled
Nov 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests/threaded: Add handy shortcuts to NEOCluster to concisely check cluster properties in tests
parent
d9dd39f0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+10
-0
neo/tests/threaded/testReplication.py
neo/tests/threaded/testReplication.py
+2
-2
No files found.
neo/tests/threaded/__init__.py
View file @
ab552d87
...
@@ -668,10 +668,20 @@ class NEOCluster(object):
...
@@ -668,10 +668,20 @@ class NEOCluster(object):
return
admin
return
admin
###
###
# More handy shortcuts for tests
@
property
def
backup_tid
(
self
):
return
self
.
neoctl
.
getRecovery
()[
1
]
@
property
def
last_tid
(
self
):
return
self
.
primary_master
.
getLastTransaction
()
@
property
@
property
def
primary_master
(
self
):
def
primary_master
(
self
):
master
,
=
[
master
for
master
in
self
.
master_list
if
master
.
primary
]
master
,
=
[
master
for
master
in
self
.
master_list
if
master
.
primary
]
return
master
return
master
###
def
reset
(
self
,
clear_database
=
False
):
def
reset
(
self
,
clear_database
=
False
):
for
node_type
in
'master'
,
'storage'
,
'admin'
:
for
node_type
in
'master'
,
'storage'
,
'admin'
:
...
...
neo/tests/threaded/testReplication.py
View file @
ab552d87
...
@@ -142,7 +142,7 @@ class ReplicationTests(NEOThreadedTest):
...
@@ -142,7 +142,7 @@ class ReplicationTests(NEOThreadedTest):
self
.
tic
()
self
.
tic
()
self
.
tic
()
self
.
tic
()
self
.
assertEqual
(
np
*
nr
,
self
.
checkBackup
(
backup
,
self
.
assertEqual
(
np
*
nr
,
self
.
checkBackup
(
backup
,
max_tid
=
backup
.
master
.
getLastTransaction
()
))
max_tid
=
backup
.
last_tid
))
finally
:
finally
:
backup
.
stop
()
backup
.
stop
()
backup
.
reset
()
backup
.
reset
()
...
@@ -160,7 +160,7 @@ class ReplicationTests(NEOThreadedTest):
...
@@ -160,7 +160,7 @@ class ReplicationTests(NEOThreadedTest):
self
.
tic
()
self
.
tic
()
self
.
tic
()
self
.
tic
()
self
.
assertEqual
(
np
*
nr
,
self
.
checkBackup
(
backup
,
self
.
assertEqual
(
np
*
nr
,
self
.
checkBackup
(
backup
,
max_tid
=
backup
.
master
.
getLastTransaction
()
))
max_tid
=
backup
.
last_tid
))
finally
:
finally
:
backup
.
stop
()
backup
.
stop
()
finally
:
finally
:
...
...
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