Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
8eef2fd1
Commit
8eef2fd1
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Plain Diff
Merge branch '
SW-954
' into 'master'
SW-954
: fixed blinking test Closes
SW-954
See merge request
!360
parents
2692f665
975fed6e
No related branches found
No related tags found
1 merge request
!360
SW-954: fixed blinking test
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LCS/Messaging/python/messaging/rpc.py
+3
-2
3 additions, 2 deletions
LCS/Messaging/python/messaging/rpc.py
LCS/Messaging/python/messaging/test/t_RPC.py
+11
-1
11 additions, 1 deletion
LCS/Messaging/python/messaging/test/t_RPC.py
with
14 additions
and
3 deletions
LCS/Messaging/python/messaging/rpc.py
+
3
−
2
View file @
8eef2fd1
...
...
@@ -382,10 +382,11 @@ class RPCClient():
tmp_reply_queue
.
address
)
answer
=
reply_receiver
.
receive
(
wait_time
)
elapsed
=
(
datetime
.
utcnow
()
-
start_time
).
total_seconds
()
if
answer
is
None
:
if
answer
is
None
or
elapsed
>
self
.
_timeout
:
raise
RPCTimeoutException
(
"
rpc call to service.method=%s via exchange=%s timed out after %.1fsec
"
%
(
service_method
,
exchange
,
s
el
f
.
_timeout
))
service_method
,
exchange
,
el
apsed
))
if
not
isinstance
(
answer
,
ReplyMessage
):
raise
ValueError
(
"
rpc call to service.method=%s via exchange=%s received an unexpected non-ReplyMessage of type %s
"
%
(
...
...
This diff is collapsed.
Click to expand it.
LCS/Messaging/python/messaging/test/t_RPC.py
+
11
−
1
View file @
8eef2fd1
...
...
@@ -110,9 +110,19 @@ class TestRPC(unittest.TestCase):
self
.
_do_call_slow_method
=
False
# notify externals that we encountered this part of the handling code
event1
.
set
()
# calling the my_public_slow_method will cause an RPCTimeout,
# resulting in this lofar_msg not being acked
# resulting in this lofar_msg being received again, and handled again, by else below.
logger
.
info
(
"
handling msg %s in the slow path... calling my_public_slow_method
"
,
lofar_msg
.
id
)
rpc_client
.
execute
(
"
my_public_slow_method
"
)
else
:
# give the rpc some slack (sometimes needed on slow systems)
rpc_client
.
_timeout
=
10
logger
.
info
(
"
handling msg %s in the fast path... calling my_public_method1
"
,
lofar_msg
.
id
)
rpc_client
.
execute
(
"
my_public_method1
"
)
logger
.
info
(
"
handled msg %s in the fast path. called my_public_method1
"
,
lofar_msg
.
id
)
# notify externals that we encountered this part of the handling code
event2
.
set
()
...
...
@@ -139,7 +149,7 @@ class TestRPC(unittest.TestCase):
event1
.
wait
(
5
)
self
.
assertTrue
(
event1
.
is_set
())
event2
.
wait
(
5
)
event2
.
wait
(
1
5
)
self
.
assertTrue
(
event2
.
is_set
())
if
__name__
==
'
__main__
'
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment