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
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
Hide 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
):
for
i
in
xrange
(
MAX_TIC_COUNT
):
if
lock
(
False
):
return
True
Serialized
.
tic
(
step
=
1
,
quiet
=
True
)
r
eturn
True
r
aise
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