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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
f77df4a3
Commit
f77df4a3
authored
Feb 02, 2010
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TestThread objects expect to have a _testcase attr, but didn't have
one. Added a constructor argument to give them one.
parent
37680ee7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
19 deletions
+20
-19
src/ZEO/tests/CommitLockTests.py
src/ZEO/tests/CommitLockTests.py
+3
-3
src/ZEO/tests/InvalidationTests.py
src/ZEO/tests/InvalidationTests.py
+15
-15
src/ZEO/tests/TestThread.py
src/ZEO/tests/TestThread.py
+2
-1
No files found.
src/ZEO/tests/CommitLockTests.py
View file @
f77df4a3
...
@@ -35,11 +35,11 @@ class WorkerThread(TestThread):
...
@@ -35,11 +35,11 @@ class WorkerThread(TestThread):
# run the entire test in a thread so that the blocking call for
# run the entire test in a thread so that the blocking call for
# tpc_vote() doesn't hang the test suite.
# tpc_vote() doesn't hang the test suite.
def
__init__
(
self
,
storage
,
trans
):
def
__init__
(
self
,
test
,
storage
,
trans
):
self
.
storage
=
storage
self
.
storage
=
storage
self
.
trans
=
trans
self
.
trans
=
trans
self
.
ready
=
threading
.
Event
()
self
.
ready
=
threading
.
Event
()
TestThread
.
__init__
(
self
)
TestThread
.
__init__
(
self
,
test
)
def
testrun
(
self
):
def
testrun
(
self
):
try
:
try
:
...
@@ -111,7 +111,7 @@ class CommitLockTests:
...
@@ -111,7 +111,7 @@ class CommitLockTests:
txn
=
transaction
.
Transaction
()
txn
=
transaction
.
Transaction
()
tid
=
self
.
_get_timestamp
()
tid
=
self
.
_get_timestamp
()
t
=
WorkerThread
(
storage
,
txn
)
t
=
WorkerThread
(
s
elf
,
s
torage
,
txn
)
self
.
_threads
.
append
(
t
)
self
.
_threads
.
append
(
t
)
t
.
start
()
t
.
start
()
t
.
ready
.
wait
()
t
.
ready
.
wait
()
...
...
src/ZEO/tests/InvalidationTests.py
View file @
f77df4a3
...
@@ -130,9 +130,9 @@ class StressThread(FailableThread):
...
@@ -130,9 +130,9 @@ class StressThread(FailableThread):
# to 'tree' until Event stop is set. If sleep is given, sleep
# to 'tree' until Event stop is set. If sleep is given, sleep
# that long after each append. At the end, instance var .added_keys
# that long after each append. At the end, instance var .added_keys
# is a list of the ints the thread believes it added successfully.
# is a list of the ints the thread believes it added successfully.
def
__init__
(
self
,
db
,
stop
,
threadnum
,
commitdict
,
def
__init__
(
self
,
testcase
,
db
,
stop
,
threadnum
,
commitdict
,
startnum
,
step
=
2
,
sleep
=
None
):
startnum
,
step
=
2
,
sleep
=
None
):
TestThread
.
__init__
(
self
)
TestThread
.
__init__
(
self
,
testcase
)
self
.
db
=
db
self
.
db
=
db
self
.
stop
=
stop
self
.
stop
=
stop
self
.
threadnum
=
threadnum
self
.
threadnum
=
threadnum
...
@@ -173,9 +173,9 @@ class LargeUpdatesThread(FailableThread):
...
@@ -173,9 +173,9 @@ class LargeUpdatesThread(FailableThread):
# more than 25 objects so that it can test code that runs vote
# more than 25 objects so that it can test code that runs vote
# in a separate thread when it modifies more than 25 objects.
# in a separate thread when it modifies more than 25 objects.
def
__init__
(
self
,
db
,
stop
,
threadnum
,
commitdict
,
startnum
,
def
__init__
(
self
,
test
,
db
,
stop
,
threadnum
,
commitdict
,
startnum
,
step
=
2
,
sleep
=
None
):
step
=
2
,
sleep
=
None
):
TestThread
.
__init__
(
self
)
TestThread
.
__init__
(
self
,
test
)
self
.
db
=
db
self
.
db
=
db
self
.
stop
=
stop
self
.
stop
=
stop
self
.
threadnum
=
threadnum
self
.
threadnum
=
threadnum
...
@@ -361,8 +361,8 @@ class InvalidationTests:
...
@@ -361,8 +361,8 @@ class InvalidationTests:
# Run two threads that update the BTree
# Run two threads that update the BTree
cd
=
{}
cd
=
{}
t1
=
self
.
StressThread
(
db1
,
stop
,
1
,
cd
,
1
)
t1
=
self
.
StressThread
(
self
,
db1
,
stop
,
1
,
cd
,
1
)
t2
=
self
.
StressThread
(
db2
,
stop
,
2
,
cd
,
2
)
t2
=
self
.
StressThread
(
self
,
db2
,
stop
,
2
,
cd
,
2
)
self
.
go
(
stop
,
cd
,
t1
,
t2
)
self
.
go
(
stop
,
cd
,
t1
,
t2
)
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
...
@@ -391,7 +391,7 @@ class InvalidationTests:
...
@@ -391,7 +391,7 @@ class InvalidationTests:
# Run threads that update the BTree
# Run threads that update the BTree
cd
=
{}
cd
=
{}
threads
=
[
self
.
StressThread
(
dbs
[
i
],
stop
,
i
,
cd
,
i
,
n
)
threads
=
[
self
.
StressThread
(
self
,
dbs
[
i
],
stop
,
i
,
cd
,
i
,
n
)
for
i
in
range
(
n
)]
for
i
in
range
(
n
)]
self
.
go
(
stop
,
cd
,
*
threads
)
self
.
go
(
stop
,
cd
,
*
threads
)
...
@@ -418,8 +418,8 @@ class InvalidationTests:
...
@@ -418,8 +418,8 @@ class InvalidationTests:
# Run two threads that update the BTree
# Run two threads that update the BTree
cd
=
{}
cd
=
{}
t1
=
self
.
StressThread
(
db1
,
stop
,
1
,
cd
,
1
,
sleep
=
0.01
)
t1
=
self
.
StressThread
(
self
,
db1
,
stop
,
1
,
cd
,
1
,
sleep
=
0.01
)
t2
=
self
.
StressThread
(
db1
,
stop
,
2
,
cd
,
2
,
sleep
=
0.01
)
t2
=
self
.
StressThread
(
self
,
db1
,
stop
,
2
,
cd
,
2
,
sleep
=
0.01
)
self
.
go
(
stop
,
cd
,
t1
,
t2
)
self
.
go
(
stop
,
cd
,
t1
,
t2
)
cn
=
db1
.
open
()
cn
=
db1
.
open
()
...
@@ -447,9 +447,9 @@ class InvalidationTests:
...
@@ -447,9 +447,9 @@ class InvalidationTests:
# at the same time.
# at the same time.
cd
=
{}
cd
=
{}
t1
=
self
.
StressThread
(
db1
,
stop
,
1
,
cd
,
1
,
3
)
t1
=
self
.
StressThread
(
self
,
db1
,
stop
,
1
,
cd
,
1
,
3
)
t2
=
self
.
StressThread
(
db2
,
stop
,
2
,
cd
,
2
,
3
,
0.01
)
t2
=
self
.
StressThread
(
self
,
db2
,
stop
,
2
,
cd
,
2
,
3
,
0.01
)
t3
=
self
.
StressThread
(
db2
,
stop
,
3
,
cd
,
3
,
3
,
0.01
)
t3
=
self
.
StressThread
(
self
,
db2
,
stop
,
3
,
cd
,
3
,
3
,
0.01
)
self
.
go
(
stop
,
cd
,
t1
,
t2
,
t3
)
self
.
go
(
stop
,
cd
,
t1
,
t2
,
t3
)
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
...
@@ -485,9 +485,9 @@ class InvalidationTests:
...
@@ -485,9 +485,9 @@ class InvalidationTests:
# at the same time.
# at the same time.
cd
=
{}
cd
=
{}
t1
=
LargeUpdatesThread
(
db1
,
stop
,
1
,
cd
,
1
,
3
,
0.02
)
t1
=
LargeUpdatesThread
(
self
,
db1
,
stop
,
1
,
cd
,
1
,
3
,
0.02
)
t2
=
LargeUpdatesThread
(
db2
,
stop
,
2
,
cd
,
2
,
3
,
0.01
)
t2
=
LargeUpdatesThread
(
self
,
db2
,
stop
,
2
,
cd
,
2
,
3
,
0.01
)
t3
=
LargeUpdatesThread
(
db2
,
stop
,
3
,
cd
,
3
,
3
,
0.01
)
t3
=
LargeUpdatesThread
(
self
,
db2
,
stop
,
3
,
cd
,
3
,
3
,
0.01
)
self
.
go
(
stop
,
cd
,
t1
,
t2
,
t3
)
self
.
go
(
stop
,
cd
,
t1
,
t2
,
t3
)
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
...
...
src/ZEO/tests/TestThread.py
View file @
f77df4a3
...
@@ -36,11 +36,12 @@ class TestThread(threading.Thread):
...
@@ -36,11 +36,12 @@ class TestThread(threading.Thread):
message.
message.
"""
"""
def
__init__
(
self
):
def
__init__
(
self
,
testcase
):
threading
.
Thread
.
__init__
(
self
)
threading
.
Thread
.
__init__
(
self
)
# In case this thread hangs, don't stop Python from exiting.
# In case this thread hangs, don't stop Python from exiting.
self
.
setDaemon
(
1
)
self
.
setDaemon
(
1
)
self
.
_exc_info
=
None
self
.
_exc_info
=
None
self
.
_testcase
=
testcase
def
run
(
self
):
def
run
(
self
):
try
:
try
:
...
...
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