]> code.ossystems Code Review - openembedded-core.git/commit
oeqa/tinfoil: Improve test_wait_event for race issues
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 7 Jul 2017 12:55:06 +0000 (13:55 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 8 Jul 2017 12:34:00 +0000 (13:34 +0100)
commit7dd5dfc4d56f1201110d947ce1ca3c6d64fbc7da
tree7e82668724cbd39e628d757663904e0270eadf44
parentc440298674ab3b960c83a127eedb9e1b66bddf78
oeqa/tinfoil: Improve test_wait_event for race issues

The test could break in a variety of ways:

a) If BB_HEARTBEAT_EVENT was less than ~0.25 it would hang indefinitely
b) The mask is set after draining the event queue meaning a heartbeat event
   could have happened
c) The test exits once it sees the events it wants, it doesn't check for
   spurious events such as heartbeats which shouldn't have occured.
d) The hardcoded delay of 0.25 is nasty and shouldn't be needed.

I found a bitbake bug and fixed that meaning we don't need the delay any
more which fixes d). That means a) is no longer an issue either.

We now set the mask, then drain the queue meaning no spurious events should
be able to sneak in. The test is also tweaked to wait for 5s in total to
ensure spurious events don't occur such as heartbeat events we shouldn't see.

[YOCTO #11045]

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/cases/tinfoil.py