Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
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
Xavier Thompson
neoppod
Commits
600cc94a
Commit
600cc94a
authored
Jan 06, 2017
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qa: in threaded tests, detect another case where a bug could call tic() endlessly
parent
744dbf5f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
neo/tests/threaded/__init__.py
neo/tests/threaded/__init__.py
+6
-3
neo/tests/zodb/testBasic.py
neo/tests/zodb/testBasic.py
+5
-1
No files found.
neo/tests/threaded/__init__.py
View file @
600cc94a
...
...
@@ -43,6 +43,7 @@ from .. import NeoTestBase, Patch, getTempDirectory, setupMySQLdb, \
BIND
=
IP_VERSION_FORMAT_DICT
[
ADDRESS_TYPE
],
0
LOCAL_IP
=
socket
.
inet_pton
(
ADDRESS_TYPE
,
IP_VERSION_FORMAT_DICT
[
ADDRESS_TYPE
])
MAX_TIC_COUNT
=
100
class
LockLock
(
object
):
...
...
@@ -255,7 +256,7 @@ class TestSerialized(Serialized):
def
poll
(
self
,
timeout
):
if
timeout
:
for
x
in
xrange
(
1000
):
for
x
in
xrange
(
MAX_TIC_COUNT
):
r
=
self
.
_epoll
.
poll
(
0
)
if
r
:
return
r
...
...
@@ -556,9 +557,11 @@ class NEOCluster(object):
def
_lock
(
blocking
=
True
):
if
blocking
:
logging
.
info
(
'<SimpleQueue>._lock.acquire()'
)
while
not
lock
(
False
):
Serialized
.
tic
(
step
=
1
,
quiet
=
True
)
for
i
in
xrange
(
MAX_TIC_COUNT
):
if
lock
(
False
):
return
True
Serialized
.
tic
(
step
=
1
,
quiet
=
True
)
raise
Exception
(
"tic is looping forever"
)
return
lock
(
False
)
self
.
_lock
=
_lock
_patches
=
(
...
...
neo/tests/zodb/testBasic.py
View file @
600cc94a
...
...
@@ -19,9 +19,13 @@ from ZODB.tests.BasicStorage import BasicStorage
from
ZODB.tests.StorageTestBase
import
StorageTestBase
from
.
import
ZODBTestCase
from
..
import
Patch
,
threaded
class
BasicTests
(
ZODBTestCase
,
StorageTestBase
,
BasicStorage
):
pass
def
check_checkCurrentSerialInTransaction
(
self
):
with
Patch
(
threaded
,
MAX_TIC_COUNT
=
100000
):
super
(
BasicTests
,
self
).
check_checkCurrentSerialInTransaction
()
if
__name__
==
"__main__"
:
suite
=
unittest
.
makeSuite
(
BasicTests
,
'check'
)
...
...
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