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
Joshua
zodb
Commits
7851cec5
Commit
7851cec5
authored
Sep 12, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge from release branch: Small overhaul of test process management.
parent
af3a121e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
13 deletions
+9
-13
src/ZEO/tests/testZEO.py
src/ZEO/tests/testZEO.py
+9
-13
No files found.
src/ZEO/tests/testZEO.py
View file @
7851cec5
...
@@ -99,7 +99,6 @@ class GenericTests(StorageTestBase.StorageTestBase,
...
@@ -99,7 +99,6 @@ class GenericTests(StorageTestBase.StorageTestBase,
def
setUp
(
self
):
def
setUp
(
self
):
zLOG
.
LOG
(
"testZEO"
,
zLOG
.
INFO
,
"setUp() %s"
%
self
.
id
())
zLOG
.
LOG
(
"testZEO"
,
zLOG
.
INFO
,
"setUp() %s"
%
self
.
id
())
self
.
running
=
1
client
,
exit
,
pid
=
forker
.
start_zeo
(
*
self
.
getStorage
())
client
,
exit
,
pid
=
forker
.
start_zeo
(
*
self
.
getStorage
())
self
.
_pids
=
[
pid
]
self
.
_pids
=
[
pid
]
self
.
_servers
=
[
exit
]
self
.
_servers
=
[
exit
]
...
@@ -107,7 +106,6 @@ class GenericTests(StorageTestBase.StorageTestBase,
...
@@ -107,7 +106,6 @@ class GenericTests(StorageTestBase.StorageTestBase,
client
.
registerDB
(
DummyDB
(),
None
)
client
.
registerDB
(
DummyDB
(),
None
)
def
tearDown
(
self
):
def
tearDown
(
self
):
self
.
running
=
0
self
.
_storage
.
close
()
self
.
_storage
.
close
()
for
server
in
self
.
_servers
:
for
server
in
self
.
_servers
:
server
.
close
()
server
.
close
()
...
@@ -225,8 +223,6 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
...
@@ -225,8 +223,6 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
The ZEO server uses the storage object returned by the
The ZEO server uses the storage object returned by the
getStorage() method.
getStorage() method.
"""
"""
zLOG
.
LOG
(
"testZEO"
,
zLOG
.
INFO
,
"setUp() %s"
%
self
.
id
())
self
.
running
=
1
self
.
file
=
tempfile
.
mktemp
()
self
.
file
=
tempfile
.
mktemp
()
self
.
addr
=
[]
self
.
addr
=
[]
self
.
_pids
=
[]
self
.
_pids
=
[]
...
@@ -254,7 +250,8 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
...
@@ -254,7 +250,8 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
"""Try to cause the tests to halt"""
"""Try to cause the tests to halt"""
if
getattr
(
self
,
'_storage'
,
None
)
is
not
None
:
if
getattr
(
self
,
'_storage'
,
None
)
is
not
None
:
self
.
_storage
.
close
()
self
.
_storage
.
close
()
self
.
shutdownServer
()
for
i
in
range
(
len
(
self
.
_servers
)):
self
.
shutdownServer
(
i
)
# file storage appears to create four files
# file storage appears to create four files
for
i
in
range
(
len
(
self
.
addr
)):
for
i
in
range
(
len
(
self
.
addr
)):
for
ext
in
''
,
'.index'
,
'.lock'
,
'.tmp'
:
for
ext
in
''
,
'.index'
,
'.lock'
,
'.tmp'
:
...
@@ -367,7 +364,6 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
...
@@ -367,7 +364,6 @@ class ConnectionTests(StorageTestBase.StorageTestBase):
zLOG
.
LOG
(
"checkReconnection"
,
zLOG
.
INFO
,
zLOG
.
LOG
(
"checkReconnection"
,
zLOG
.
INFO
,
"About to shutdown server"
)
"About to shutdown server"
)
self
.
shutdownServer
()
self
.
shutdownServer
()
self
.
running
=
1
zLOG
.
LOG
(
"checkReconnection"
,
zLOG
.
INFO
,
zLOG
.
LOG
(
"checkReconnection"
,
zLOG
.
INFO
,
"About to restart server"
)
"About to restart server"
)
self
.
_startServer
(
create
=
0
)
self
.
_startServer
(
create
=
0
)
...
@@ -402,13 +398,13 @@ class UnixConnectionTests(ConnectionTests):
...
@@ -402,13 +398,13 @@ class UnixConnectionTests(ConnectionTests):
self
.
_servers
.
append
(
server
)
self
.
_servers
.
append
(
server
)
def
shutdownServer
(
self
,
index
=
0
):
def
shutdownServer
(
self
,
index
=
0
):
if
self
.
running
:
self
.
running
=
0
self
.
_servers
[
index
].
close
()
self
.
_servers
[
index
].
close
()
if
self
.
_pids
[
index
]
is
not
None
:
try
:
try
:
os
.
waitpid
(
self
.
_pids
[
index
],
0
)
os
.
waitpid
(
self
.
_pids
[
index
],
0
)
except
os
.
error
:
self
.
_pids
[
index
]
=
None
pass
except
os
.
error
,
err
:
print
err
class
WindowsConnectionTests
(
ConnectionTests
):
class
WindowsConnectionTests
(
ConnectionTests
):
...
@@ -421,11 +417,11 @@ class WindowsConnectionTests(ConnectionTests):
...
@@ -421,11 +417,11 @@ class WindowsConnectionTests(ConnectionTests):
self
.
_servers
.
append
(
test_addr
)
self
.
_servers
.
append
(
test_addr
)
def
shutdownServer
(
self
,
index
=
0
):
def
shutdownServer
(
self
,
index
=
0
):
if
self
.
running
:
if
self
.
_servers
[
index
]
is
not
None
:
self
.
running
=
0
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
s
.
connect
(
self
.
_servers
[
index
])
s
.
connect
(
self
.
_servers
[
index
])
s
.
close
()
s
.
close
()
self
.
_servers
[
index
]
=
None
# XXX waitpid() isn't available until Python 2.3
# XXX waitpid() isn't available until Python 2.3
time
.
sleep
(
0.5
)
time
.
sleep
(
0.5
)
...
...
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