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
cc707ab6
Commit
cc707ab6
authored
Jul 24, 2008
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed spurious scary intermittent test failure.
parent
8f5a656d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
14 deletions
+20
-14
src/ZEO/tests/InvalidationTests.py
src/ZEO/tests/InvalidationTests.py
+20
-14
No files found.
src/ZEO/tests/InvalidationTests.py
View file @
cc707ab6
...
...
@@ -144,24 +144,25 @@ class StressThread(FailableThread):
self
.
commitdict
=
commitdict
def
_testrun
(
self
):
cn
=
self
.
db
.
open
()
tm
=
transaction
.
TransactionManager
()
cn
=
self
.
db
.
open
(
transaction_manager
=
tm
)
while
not
self
.
stop
.
isSet
():
try
:
tree
=
cn
.
root
()[
"tree"
]
break
except
(
ConflictError
,
KeyError
):
t
ransaction
.
abort
()
t
m
.
abort
()
key
=
self
.
startnum
while
not
self
.
stop
.
isSet
():
try
:
tree
[
key
]
=
self
.
threadnum
t
ransaction
.
get
().
note
(
"add key %s"
%
key
)
t
ransaction
.
commit
()
t
m
.
get
().
note
(
"add key %s"
%
key
)
t
m
.
commit
()
self
.
commitdict
[
self
]
=
1
if
self
.
sleep
:
time
.
sleep
(
self
.
sleep
)
except
(
ReadConflictError
,
ConflictError
),
msg
:
t
ransaction
.
abort
()
t
m
.
abort
()
else
:
self
.
added_keys
.
append
(
key
)
key
+=
self
.
step
...
...
@@ -338,16 +339,23 @@ class InvalidationTests:
def
_check_threads
(
self
,
tree
,
*
threads
):
# Make sure the thread's view of the world is consistent with
# the actual database state.
expected_keys
=
[]
errormsgs
=
[]
err
=
errormsgs
.
append
for
t
in
threads
:
if
not
t
.
added_keys
:
err
(
"thread %d didn't add any keys"
%
t
.
threadnum
)
expected_keys
.
extend
(
t
.
added_keys
)
expected_keys
.
sort
()
actual_keys
=
list
(
tree
.
keys
())
if
expected_keys
!=
actual_keys
:
for
i
in
range
(
100
):
tree
.
_p_jar
.
sync
()
actual_keys
=
list
(
tree
.
keys
())
if
expected_keys
==
actual_keys
:
break
time
.
sleep
(.
1
)
else
:
errormsgs
=
[]
err
=
errormsgs
.
append
err
(
"expected keys != actual keys"
)
for
k
in
expected_keys
:
if
k
not
in
actual_keys
:
...
...
@@ -355,8 +363,7 @@ class InvalidationTests:
for
k
in
actual_keys
:
if
k
not
in
expected_keys
:
err
(
"key %s in tree but not expected"
%
k
)
if
errormsgs
:
display
(
tree
)
self
.
fail
(
'
\
n
'
.
join
(
errormsgs
))
def
go
(
self
,
stop
,
commitdict
,
*
threads
):
...
...
@@ -488,10 +495,9 @@ class InvalidationTests:
self
.
go
(
stop
,
cd
,
t1
,
t2
,
t3
)
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
db1
.
_storage
.
sync
()
db2
.
_storage
.
sync
()
time
.
sleep
(.
1
)
time
.
sleep
(.
1
)
cn
=
db1
.
open
()
tree
=
cn
.
root
()[
"tree"
]
self
.
_check_tree
(
cn
,
tree
)
...
...
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