Commit 162b4004 authored by Federico Vaga's avatar Federico Vaga Committed by Federico Vaga

tst: wait for IRQ to happen before stats check

The system needs time for an IRQ to happen before we are able to see a
change in the HMQ statistics. Waiting 10ms seems reasonable.

Increase also the timeout on the firmware side to 1 second. With these
tests, we are interested in the functionality and not (at least today)
to its performance.

However this test was working fine in the past. For some reason now
there a component that is slower, or faster, than before.

For sure the Python interpreter is different and it could be that is now
much faster compared to some years ago when probably we tested this with
Python 2.7.
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent 27f88d60
......@@ -29,8 +29,8 @@ int main()
p = msg.payload;
for (count = 1, run = 1; run; ++count) {
/* Wait incoming message - 100ms timeout */
status = mq_poll_in_wait(TRTL_HMQ, 1 << hmq, 100000);
/* Wait incoming message - 1s timeout */
status = mq_poll_in_wait(TRTL_HMQ, 1 << hmq, 1000000);
if (!status) {
pr_error("\tNO MESSAGE PENDING h:%d, cnt:0x%x\r\n",
hmq, count);
......
......@@ -100,6 +100,7 @@ class TestHmq(object):
for msg in trtl_msg:
sb = hmq.get_stats()
hmq.send_msg(msg)
time.sleep(0.01)
sa = hmq.get_stats()
assert sb["message_sent"] + 1 == sa["message_sent"]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment