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
Kirill Smelkov
ZODB
Commits
90f912c9
Commit
90f912c9
authored
Feb 06, 2023
by
Dieter Maurer
Committed by
GitHub
Feb 06, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #376 from zopefoundation/fix_racetests
Fix `racetest` problems
parents
9ffc59e5
618a79c1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
5 deletions
+20
-5
CHANGES.rst
CHANGES.rst
+3
-0
src/ZODB/scripts/zodbload.py
src/ZODB/scripts/zodbload.py
+1
-1
src/ZODB/tests/racetest.py
src/ZODB/tests/racetest.py
+16
-4
No files found.
CHANGES.rst
View file @
90f912c9
...
...
@@ -5,6 +5,9 @@
5.8.1 (unreleased)
==================
- Fix ``racetest`` problems.
For details see `#376 <https://github.com/zopefoundation/ZODB/pull/376>`_.
5.8.0 (2022-11-09)
==================
...
...
src/ZODB/scripts/zodbload.py
View file @
90f912c9
...
...
@@ -227,7 +227,7 @@ def VmSize():
except
:
# noqa: E722 do not use bare 'except'
return
0
else
:
l_
=
list
(
filter
(
lambda
l
:
l
[:
7
]
==
'VmSize:'
,
lines
))
l_
=
list
(
filter
(
lambda
l
:
l
[:
7
]
==
'VmSize:'
,
lines
))
# noqa: E741
if
l_
:
l_
=
l_
[
0
][
7
:].
strip
().
split
()[
0
]
return
int
(
l_
)
...
...
src/ZODB/tests/racetest.py
View file @
90f912c9
...
...
@@ -214,9 +214,9 @@ class RaceTests(object):
init
()
N
=
500
tverify
=
threading
.
Thread
(
tverify
=
Daemon
(
name
=
'Tverify'
,
target
=
xrun
,
args
=
(
verify
,
N
))
tmodify
=
threading
.
Thread
(
tmodify
=
Daemon
(
name
=
'Tmodify'
,
target
=
xrun
,
args
=
(
modify
,
N
))
tverify
.
start
()
tmodify
.
start
()
...
...
@@ -340,7 +340,7 @@ class RaceTests(object):
N
=
100
tg
=
[]
for
x
in
range
(
nwork
):
t
=
threading
.
Thread
(
name
=
'T%d'
%
x
,
target
=
T
,
args
=
(
x
,
N
))
t
=
Daemon
(
name
=
'T%d'
%
x
,
target
=
T
,
args
=
(
x
,
N
))
t
.
start
()
tg
.
append
(
t
)
...
...
@@ -446,7 +446,7 @@ class RaceTests(object):
N
=
100
//
(
2
*
4
)
# N reduced to save time
tg
=
[]
for
x
in
range
(
nwork
):
t
=
threading
.
Thread
(
name
=
'T%d'
%
x
,
target
=
T
,
args
=
(
x
,
N
))
t
=
Daemon
(
name
=
'T%d'
%
x
,
target
=
T
,
args
=
(
x
,
N
))
t
.
start
()
tg
.
append
(
t
)
...
...
@@ -524,3 +524,15 @@ def _state_details(root): # -> txt
txt
+=
load
(
k
)
return
txt
class
Daemon
(
threading
.
Thread
):
"""auxiliary class to create daemon threads and fail if not stopped."""
def
__init__
(
self
,
**
kw
):
super
(
Daemon
,
self
).
__init__
(
**
kw
)
self
.
daemon
=
True
def
join
(
self
,
*
args
,
**
kw
):
super
(
Daemon
,
self
).
join
(
*
args
,
**
kw
)
if
self
.
is_alive
():
raise
AssertionError
(
"Thread %s did not stop"
%
self
.
name
)
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