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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefane Fermigier
neo
Commits
a63bf12f
Commit
a63bf12f
authored
Nov 26, 2015
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
threaded: prevent neoctl to loop forever when something went wrong during the test
parent
fe487c07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+3
-2
neo/tests/threaded/test.py
neo/tests/threaded/test.py
+3
-0
No files found.
neo/tests/threaded/__init__.py
View file @
a63bf12f
...
@@ -219,11 +219,12 @@ class TestSerialized(Serialized):
...
@@ -219,11 +219,12 @@ class TestSerialized(Serialized):
def
poll
(
self
,
timeout
):
def
poll
(
self
,
timeout
):
if
timeout
:
if
timeout
:
while
1
:
for
x
in
xrange
(
1000
)
:
r
=
self
.
_epoll
.
poll
(
0
)
r
=
self
.
_epoll
.
poll
(
0
)
if
r
:
if
r
:
return
r
return
r
Serialized
.
tic
(
step
=
1
)
Serialized
.
tic
(
step
=
1
)
raise
Exception
(
"tic is looping forever"
)
return
self
.
_epoll
.
poll
(
timeout
)
return
self
.
_epoll
.
poll
(
timeout
)
...
@@ -704,7 +705,7 @@ class NEOCluster(object):
...
@@ -704,7 +705,7 @@ class NEOCluster(object):
def
join
(
self
,
thread_list
,
timeout
=
5
):
def
join
(
self
,
thread_list
,
timeout
=
5
):
timeout
+=
time
.
time
()
timeout
+=
time
.
time
()
while
thread_list
:
while
thread_list
:
assert
time
.
time
()
<
timeout
assert
time
.
time
()
<
timeout
,
thread_list
Serialized
.
tic
()
Serialized
.
tic
()
thread_list
=
[
t
for
t
in
thread_list
if
t
.
is_alive
()]
thread_list
=
[
t
for
t
in
thread_list
if
t
.
is_alive
()]
...
...
neo/tests/threaded/test.py
View file @
a63bf12f
...
@@ -560,6 +560,9 @@ class Test(NEOThreadedTest):
...
@@ -560,6 +560,9 @@ class Test(NEOThreadedTest):
cluster
.
stop
()
cluster
.
stop
()
def
testShutdown
(
self
):
def
testShutdown
(
self
):
# BUG: Due to bugs in election, master nodes sometimes crash, or they
# declare themselves primary too quickly. The consequence is
# often an endless tic loop.
cluster
=
NEOCluster
(
master_count
=
3
,
partitions
=
10
,
cluster
=
NEOCluster
(
master_count
=
3
,
partitions
=
10
,
replicas
=
1
,
storage_count
=
3
)
replicas
=
1
,
storage_count
=
3
)
try
:
try
:
...
...
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