Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
88e7a72a
Commit
88e7a72a
authored
Apr 09, 2013
by
Michal 'vorner' Vaner
Browse files
Merge #2888
Fix failure to connect in msgq tests.
parents
0d8a7d1e
bd65ec46
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/bin/msgq/tests/msgq_run_test.py
View file @
88e7a72a
...
...
@@ -72,12 +72,21 @@ class MsgqRunTest(unittest.TestCase):
# Start msgq
self
.
__msgq
=
subprocess
.
Popen
([
MSGQ_PATH
,
'-s'
,
SOCKET_PATH
],
close_fds
=
True
)
# Wait for it to become ready (up to the alarm-set timeout)
while
not
os
.
path
.
exists
(
SOCKET_PATH
):
# Just a short wait, so we don't hog CPU, but don't wait too long
time
.
sleep
(
0.01
)
# Some testing data
self
.
__no_recpt
=
{
"result"
:
[
-
1
,
"No such recipient"
]}
# Wait for it to become ready (up to the alarm-set timeout)
connection
=
None
while
not
connection
:
try
:
# If the msgq is ready, this'll succeed. If not, it'll throw
# session error.
connection
=
isc
.
cc
.
session
.
Session
(
SOCKET_PATH
)
except
isc
.
cc
.
session
.
SessionError
:
time
.
sleep
(
0.1
)
# Retry after a short time
# We have the connection now, that means it works. Close this
# connection, we won't use it. Each test gets enough new connections
# of its own.
connection
.
close
()
def
__message
(
self
,
data
):
"""
...
...
src/lib/python/isc/cc/session.py
View file @
88e7a72a
...
...
@@ -67,7 +67,9 @@ class Session:
logger
.
debug
(
logger
.
DBGLVL_TRACE_BASIC
,
PYCC_LNAME_RECEIVED
,
self
.
_lname
)
except
socket
.
error
as
se
:
raise
SessionError
(
se
)
if
self
.
_socket
:
self
.
_socket
.
close
()
raise
SessionError
(
se
)
@
property
def
lname
(
self
):
...
...
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