Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
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
nexedi
ZODB
Commits
9533ce76
Commit
9533ce76
authored
May 09, 2019
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bound the amount of time we wait for the client thread to exit.
parent
e454ce4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
.coveragerc
.coveragerc
+1
-0
src/ZODB/tests/testThreadedShutdown.py
src/ZODB/tests/testThreadedShutdown.py
+8
-3
No files found.
.coveragerc
View file @
9533ce76
...
...
@@ -11,3 +11,4 @@ exclude_lines =
pragma: no cover
if __name__ == ['"]__main__['"]:
assert False
self.fail
src/ZODB/tests/testThreadedShutdown.py
View file @
9533ce76
...
...
@@ -7,6 +7,8 @@ import ZODB
class
ZODBClientThread
(
threading
.
Thread
):
sleep_time
=
15
def
__init__
(
self
,
db
,
test
):
threading
.
Thread
.
__init__
(
self
)
self
.
_exc_info
=
None
...
...
@@ -19,7 +21,7 @@ class ZODBClientThread(threading.Thread):
conn
=
self
.
db
.
open
()
conn
.
sync
()
self
.
event
.
set
()
time
.
sleep
(
15
)
time
.
sleep
(
self
.
sleep_time
)
# conn.close calls self.transaction_manager.unregisterSynch(self)
# and this succeeds.
...
...
@@ -50,8 +52,11 @@ class ShutdownTest(ZODB.tests.util.TestCase):
# have different contents.
self
.
_db
.
close
()
# Be sure not to 'leak' the running thread.
client_thread
.
join
()
# Be sure not to 'leak' the running thread; if it hasn't
# finished after this, something went very wrong
client_thread
.
join
(
client_thread
.
sleep_time
+
10
)
if
client_thread
.
is_alive
():
self
.
fail
(
"Client thread failed to close connection"
)
def
test_suite
():
...
...
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