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:57:01 +0100 |
commit | 30d88a20432d2ddca555c9b6690450b260e523ec (patch) | |
tree | c825e9d257608b0ecab8185f3dee938068841056 /meta/lib | |
parent | 66f2f710e6364093cb16cc67ea0fdf69f4b20843 (diff) | |
download | poky-30d88a20432d2ddca555c9b6690450b260e523ec.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.
(From OE-Core rev: 8cfc94a4404c54bc73eab9f98d9da1f84c2135ad)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-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 | |||
772 | 772 | ||
773 | def find_siginfo(pn, taskname, sigs=None): | 773 | def find_siginfo(pn, taskname, sigs=None): |
774 | result = None | 774 | result = None |
775 | command_complete = False | ||
775 | tinfoil.set_event_mask(["bb.event.FindSigInfoResult", | 776 | tinfoil.set_event_mask(["bb.event.FindSigInfoResult", |
776 | "bb.command.CommandCompleted"]) | 777 | "bb.command.CommandCompleted"]) |
777 | ret = tinfoil.run_command("findSigInfo", pn, taskname, sigs) | 778 | ret = tinfoil.run_command("findSigInfo", pn, taskname, sigs) |
778 | if ret: | 779 | if ret: |
779 | while True: | 780 | while result is None or not command_complete: |
780 | event = tinfoil.wait_event(1) | 781 | event = tinfoil.wait_event(1) |
781 | if event: | 782 | if event: |
782 | if isinstance(event, bb.command.CommandCompleted): | 783 | if isinstance(event, bb.command.CommandCompleted): |
783 | break | 784 | command_complete = True |
784 | elif isinstance(event, bb.event.FindSigInfoResult): | 785 | elif isinstance(event, bb.event.FindSigInfoResult): |
785 | result = event.result | 786 | result = event.result |
786 | return result | 787 | return result |