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
31574dcc
Commit
31574dcc
authored
Oct 31, 2016
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
b580f89b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
14 deletions
+20
-14
neo/lib/connector.py
neo/lib/connector.py
+1
-1
neo/scripts/runner.py
neo/scripts/runner.py
+1
-1
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+13
-7
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+2
-2
neo/tests/threaded/testSSL.py
neo/tests/threaded/testSSL.py
+3
-3
No files found.
neo/lib/connector.py
View file @
31574dcc
...
...
@@ -32,7 +32,7 @@ class SocketConnector(object):
is_closed
=
is_server
=
None
connect_limit
=
{}
CONNECT_LIMIT
=
1
CONNECT_LIMIT
=
1
# XXX actually this is (RE-)CONNECT_THROTTLE
def
__new__
(
cls
,
addr
,
s
=
None
):
if
s
is
None
:
...
...
neo/scripts/runner.py
View file @
31574dcc
...
...
@@ -64,7 +64,7 @@ UNIT_TEST_MODULES = [
'neo.tests.threaded.test'
,
'neo.tests.threaded.testImporter'
,
'neo.tests.threaded.testReplication'
,
'neo.tests.threaded.testSSL'
,
#
'neo.tests.threaded.testSSL',
]
FUNC_TEST_MODULES
=
[
...
...
neo/tests/threaded/__init__.py
View file @
31574dcc
...
...
@@ -228,10 +228,13 @@ class Serialized(object):
self
.
_busy
.
add
(
self
)
# block tic until app waits for polling
def
__getattr__
(
self
,
attr
):
# to original .app.epoll.xxx(
if
attr
in
(
'close'
,
'modify'
,
'register'
,
'unregister'
):
return
getattr
(
self
.
_epoll
,
attr
)
return
self
.
__getattribute__
(
attr
)
# NOTE poll() / _release_next() (& exit()) are adjusted hooks for
# interaction with scheduler (in .tic())
def
poll
(
self
,
timeout
):
if
self
.
check_timeout
:
assert
timeout
>=
0
,
(
self
,
timeout
)
...
...
@@ -263,7 +266,7 @@ class Serialized(object):
cls
.
_epoll
.
unregister
(
fd
)
self
.
_release_next
()
class
TestSerialized
(
Serialized
):
class
TestSerialized
(
Serialized
):
# NOTE used only in .NeoCTL
def
__init__
(
*
args
):
Serialized
.
__init__
(
busy
=
False
,
*
args
)
...
...
@@ -295,7 +298,7 @@ class Node(object):
class
ServerNode
(
Node
):
_server_class_dict
=
{}
_server_class_dict
=
{}
# virt-ip -> class
class
__metaclass__
(
type
):
def
__init__
(
cls
,
name
,
bases
,
d
):
...
...
@@ -314,12 +317,12 @@ class ServerNode(Node):
@
classmethod
def
newAddress
(
cls
):
address
=
cls
.
_virtual_ip
,
len
(
cls
.
_node_list
)
address
=
cls
.
_virtual_ip
,
len
(
cls
.
_node_list
)
# NOTE addr is vip, #node
cls
.
_node_list
.
append
(
None
)
return
address
@
classmethod
def
resolv
(
cls
,
address
):
def
resolv
(
cls
,
address
):
# (vip, #node) -> (vip', port)
try
:
cls
=
cls
.
_server_class_dict
[
address
[
0
]]
except
KeyError
:
...
...
@@ -345,6 +348,7 @@ class ServerNode(Node):
self
.
node_name
=
'%s_%u'
%
(
self
.
node_type
,
port
)
kw
.
update
(
getCluster
=
name
,
getBind
=
address
,
getMasters
=
master_nodes
and
parseMasterList
(
master_nodes
,
address
))
# -> app.__init__() ; Mock serves as config
super
(
ServerNode
,
self
).
__init__
(
Mock
(
kw
))
def
getVirtualAddress
(
self
):
...
...
@@ -411,6 +415,7 @@ class StorageApplication(ServerNode, neo.storage.app.Application):
def
getAdapter
(
self
):
return
self
.
_init_args
[
'getAdapter'
]
# get {} oid -> nlocks ; !0 - in staging area for commit (and for how many txn), oid from whole DB
def
getDataLockInfo
(
self
):
dm
=
self
.
dm
index
=
tuple
(
dm
.
query
(
"SELECT id, hash, compression FROM data"
))
...
...
@@ -472,6 +477,8 @@ class LoggerThreadName(str):
return
str
.
__str__
(
self
)
# filters-out packet which are detected by filter-criterions setup with .add()
# for a packed detected tobe filtered; further pkts on same conn are always filtered
class
ConnectionFilter
(
object
):
filtered_count
=
0
...
...
@@ -626,7 +633,6 @@ class NEOCluster(object):
kw
=
dict
(
cluster
=
weak_self
,
getReplicas
=
replicas
,
getAdapter
=
adapter
,
getPartitions
=
partitions
,
getReset
=
clear_databases
,
getSSL
=
self
.
SSL
)
# NOTE
if
upstream
is
not
None
:
self
.
upstream
=
weakref
.
proxy
(
upstream
)
kw
.
update
(
getUpstreamCluster
=
upstream
.
name
,
...
...
@@ -833,7 +839,7 @@ class NEOCluster(object):
__print_exc
()
raise
def
extraCellSortKey
(
self
,
key
):
def
extraCellSortKey
(
self
,
key
):
# XXX unused?
return
Patch
(
self
.
client
.
cp
,
getCellSortKey
=
lambda
orig
,
cell
:
(
orig
(
cell
),
key
(
cell
)))
...
...
@@ -896,7 +902,7 @@ class NEOThreadedTest(NeoTestBase):
reset
()
return
conn
def
getUnpickler
(
self
,
conn
):
def
getUnpickler
(
self
,
conn
):
# XXX not used?
reader
=
conn
.
_reader
def
unpickler
(
data
,
compression
=
False
):
if
compression
:
...
...
neo/tests/threaded/test.py
View file @
31574dcc
...
...
@@ -189,7 +189,7 @@ class Test(NEOThreadedTest):
finally
:
cluster
.
stop
()
@
expectedFailure
(
POSException
.
ConflictError
)
@
expectedFailure
(
POSException
.
ConflictError
)
# TODO recheck
def
testUndoConflictDuringStore
(
self
):
self
.
testUndoConflict
(
True
)
...
...
@@ -338,7 +338,7 @@ class Test(NEOThreadedTest):
self
.
assertEqual
(
self
.
_testDeadlockAvoidance
([
2
,
4
]),
[
DelayedError
,
DelayedError
,
ConflictError
,
ConflictError
])
@
expectedFailure
(
POSException
.
ConflictError
)
@
expectedFailure
(
POSException
.
ConflictError
)
# XXX recheck
def
testDeadlockAvoidance
(
self
):
# This test fail because deadlock avoidance is not fully implemented.
# 0: C1 -> S1
...
...
neo/tests/threaded/testSSL.py
View file @
31574dcc
...
...
@@ -33,8 +33,8 @@ class SSLMixin:
class
SSLTests
(
SSLMixin
,
test
.
Test
):
# exclude expected failures
testDeadlockAvoidance
=
None
testUndoConflict
=
testUndoConflictDuringStore
=
None
testDeadlockAvoidance
=
None
# XXX why this fails?
testUndoConflict
=
testUndoConflictDuringStore
=
None
# XXX why this fails?
def
testAbortConnection
(
self
):
for
after_handshake
in
1
,
0
:
...
...
@@ -60,7 +60,7 @@ class SSLTests(SSLMixin, test.Test):
class
SSLReplicationTests
(
SSLMixin
,
testReplication
.
ReplicationTests
):
# do not repeat slowest tests with SSL
testBackupNodeLost
=
testBackupNormalCase
=
None
testBackupNodeLost
=
testBackupNormalCase
=
None
# TODO recheck
if
__name__
==
"__main__"
:
...
...
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