Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
f-interop-contributors
ioppytest
Commits
d06dc5ab
Commit
d06dc5ab
authored
Feb 02, 2018
by
Federico Sismondi
Browse files
fine-tunning timers for avoiding UI error
parent
2479c2df
Pipeline
#2057
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
ioppytest/finterop_ui_adaptor/__main__.py
View file @
d06dc5ab
...
...
@@ -48,6 +48,9 @@ json_formatter = JsonFormatter()
rabbitmq_handler
.
setFormatter
(
json_formatter
)
logger
.
addHandler
(
rabbitmq_handler
)
# timer used to avoid bumpping into UI error (message dropped on two "simultaneous" messages arrival )
PUBLISH_DELAY
=
0.1
mapping_testsuite_to_message_translator
=
{
'dummy'
:
DummySessionMessageTranslator
,
'coap'
:
CoAPSessionMessageTranslator
,
...
...
@@ -190,6 +193,7 @@ class AmqpMessagePublisher:
repr
(
message
)[:
STDOUT_MAX_STRING_LENGTH
],))
try
:
time
.
sleep
(
PUBLISH_DELAY
)
channel
=
self
.
connection
.
channel
()
channel
.
basic_publish
(
exchange
=
AMQP_EXCHANGE
,
...
...
@@ -281,6 +285,7 @@ class AmqpMessagePublisher:
))
# fixme in amqp request use timeout instead of retries
time
.
sleep
(
PUBLISH_DELAY
)
resp
=
amqp_request
(
self
.
connection
,
request
,
COMPONENT_ID
,
retries
=
timeout
*
2
)
return
resp
...
...
@@ -662,7 +667,6 @@ def main():
# TODO implement a mechanism for not publish messages until previous one has been replied,
# how to handle the ui.user.request cancel command tho?
time
.
sleep
(
0.2
)
if
not
queue_messages_request_to_ui
.
empty
():
# get next request
request
=
queue_messages_request_to_ui
.
get
()
...
...
@@ -675,7 +679,6 @@ def main():
request_message
=
request
,
requested_field_name_list
=
requested_fields
,
)
time
.
sleep
(
0.2
)
# get next message reply from UI
if
not
queue_messages_from_ui
.
empty
():
...
...
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