diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-03-30 18:08:15 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-03-31 06:56:57 +0100 |
commit | 8cfc94a4404c54bc73eab9f98d9da1f84c2135ad (patch) | |
tree | cf512f85f36f8f0f2115bad3ac8258d7558d8a27 /meta/lib/oeqa | |
parent | fac4d33041d8feb041e617b9b16689c4d3a522cb (diff) | |
download | openembedded-core-contrib-8cfc94a4404c54bc73eab9f98d9da1f84c2135ad.tar.gz |
oeqa/sstatetests: Fix race issue
Under some load conditions, the result event can come back before the
command complete event. If that happens, the code would hang
indefinitely.
Rework the code to wait for both events and avoid the hang.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa')
-rw-r--r-- | meta/lib/oeqa/selftest/cases/sstatetests.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/lib/oeqa/selftest/cases/sstatetests.py b/meta/lib/oeqa/selftest/cases/sstatetests.py index e2f509c3e8..86d6cd7464 100644 --- a/meta/lib/oeqa/selftest/cases/sstatetests.py +++ b/meta/lib/oeqa/selftest/cases/sstatetests.py @@ -772,15 +772,16 @@ addtask tmptask2 before do_tmptask1 def find_siginfo(pn, taskname, sigs=None): result = None + command_complete = False tinfoil.set_event_mask(["bb.event.FindSigInfoResult", "bb.command.CommandCompleted"]) ret = tinfoil.run_command("findSigInfo", pn, taskname, sigs) if ret: - while True: + while result is None or not command_complete: event = tinfoil.wait_event(1) if event: if isinstance(event, bb.command.CommandCompleted): - break + command_complete = True elif isinstance(event, bb.event.FindSigInfoResult): result = event.result return result |