Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZEO
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
ZEO
Commits
6ee6f211
Commit
6ee6f211
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
8bdffbf6
Changes
3
Show 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 @
6ee6f211
...
...
@@ -35,11 +35,11 @@ class WorkerThread(TestThread):
# run the entire test in a thread so that the blocking call for
# tpc_vote() doesn't hang the test suite.
def
__init__
(
self
,
storage
,
trans
):
def
__init__
(
self
,
test
,
storage
,
trans
):
self
.
storage
=
storage
self
.
trans
=
trans
self
.
ready
=
threading
.
Event
()
TestThread
.
__init__
(
self
)
TestThread
.
__init__
(
self
,
test
)
def
testrun
(
self
):
try
:
...
...
@@ -111,7 +111,7 @@ class CommitLockTests:
txn
=
transaction
.
Transaction
()
tid
=
self
.
_get_timestamp
()
t
=
WorkerThread
(
storage
,
txn
)
t
=
WorkerThread
(
s
elf
,
s
torage
,
txn
)
self
.
_threads
.
append
(
t
)
t
.
start
()
t
.
ready
.
wait
()
...
...
src/ZEO/tests/InvalidationTests.py
View file @
6ee6f211
...
...
@@ -130,9 +130,9 @@ class StressThread(FailableThread):
# to 'tree' until Event stop is set. If sleep is given, sleep
# that long after each append. At the end, instance var .added_keys
# 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
):
TestThread
.
__init__
(
self
)
TestThread
.
__init__
(
self
,
testcase
)
self
.
db
=
db
self
.
stop
=
stop
self
.
threadnum
=
threadnum
...
...
@@ -173,9 +173,9 @@ class LargeUpdatesThread(FailableThread):
# more than 25 objects so that it can test code that runs vote
# 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
):
TestThread
.
__init__
(
self
)
TestThread
.
__init__
(
self
,
test
)
self
.
db
=
db
self
.
stop
=
stop
self
.
threadnum
=
threadnum
...
...
@@ -361,8 +361,8 @@ class InvalidationTests:
# Run two threads that update the BTree
cd
=
{}
t1
=
self
.
StressThread
(
db1
,
stop
,
1
,
cd
,
1
)
t2
=
self
.
StressThread
(
db2
,
stop
,
2
,
cd
,
2
)
t1
=
self
.
StressThread
(
self
,
db1
,
stop
,
1
,
cd
,
1
)
t2
=
self
.
StressThread
(
self
,
db2
,
stop
,
2
,
cd
,
2
)
self
.
go
(
stop
,
cd
,
t1
,
t2
)
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
...
...
@@ -391,7 +391,7 @@ class InvalidationTests:
# Run threads that update the BTree
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
)]
self
.
go
(
stop
,
cd
,
*
threads
)
...
...
@@ -418,8 +418,8 @@ class InvalidationTests:
# Run two threads that update the BTree
cd
=
{}
t1
=
self
.
StressThread
(
db1
,
stop
,
1
,
cd
,
1
,
sleep
=
0.01
)
t2
=
self
.
StressThread
(
db1
,
stop
,
2
,
cd
,
2
,
sleep
=
0.01
)
t1
=
self
.
StressThread
(
self
,
db1
,
stop
,
1
,
cd
,
1
,
sleep
=
0.01
)
t2
=
self
.
StressThread
(
self
,
db1
,
stop
,
2
,
cd
,
2
,
sleep
=
0.01
)
self
.
go
(
stop
,
cd
,
t1
,
t2
)
cn
=
db1
.
open
()
...
...
@@ -447,9 +447,9 @@ class InvalidationTests:
# at the same time.
cd
=
{}
t1
=
self
.
StressThread
(
db1
,
stop
,
1
,
cd
,
1
,
3
)
t2
=
self
.
StressThread
(
db2
,
stop
,
2
,
cd
,
2
,
3
,
0.01
)
t3
=
self
.
StressThread
(
db2
,
stop
,
3
,
cd
,
3
,
3
,
0.01
)
t1
=
self
.
StressThread
(
self
,
db1
,
stop
,
1
,
cd
,
1
,
3
)
t2
=
self
.
StressThread
(
self
,
db2
,
stop
,
2
,
cd
,
2
,
3
,
0.01
)
t3
=
self
.
StressThread
(
self
,
db2
,
stop
,
3
,
cd
,
3
,
3
,
0.01
)
self
.
go
(
stop
,
cd
,
t1
,
t2
,
t3
)
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
...
...
@@ -485,9 +485,9 @@ class InvalidationTests:
# at the same time.
cd
=
{}
t1
=
LargeUpdatesThread
(
db1
,
stop
,
1
,
cd
,
1
,
3
,
0.02
)
t2
=
LargeUpdatesThread
(
db2
,
stop
,
2
,
cd
,
2
,
3
,
0.01
)
t3
=
LargeUpdatesThread
(
db2
,
stop
,
3
,
cd
,
3
,
3
,
0.01
)
t1
=
LargeUpdatesThread
(
self
,
db1
,
stop
,
1
,
cd
,
1
,
3
,
0.02
)
t2
=
LargeUpdatesThread
(
self
,
db2
,
stop
,
2
,
cd
,
2
,
3
,
0.01
)
t3
=
LargeUpdatesThread
(
self
,
db2
,
stop
,
3
,
cd
,
3
,
3
,
0.01
)
self
.
go
(
stop
,
cd
,
t1
,
t2
,
t3
)
while
db1
.
lastTransaction
()
!=
db2
.
lastTransaction
():
...
...
src/ZEO/tests/TestThread.py
View file @
6ee6f211
...
...
@@ -36,11 +36,12 @@ class TestThread(threading.Thread):
message.
"""
def
__init__
(
self
):
def
__init__
(
self
,
testcase
):
threading
.
Thread
.
__init__
(
self
)
# In case this thread hangs, don't stop Python from exiting.
self
.
setDaemon
(
1
)
self
.
_exc_info
=
None
self
.
_testcase
=
testcase
def
run
(
self
):
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