Skip to content

Commit

Permalink
Merge pull request #5784 from clebergnu/statemachine_trivial
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Richter <[email protected]>
  • Loading branch information
richtja authored Oct 27, 2023
2 parents a414247 + c77d8eb commit 9d5c42f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions avocado/core/task/statemachine.py
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,9 @@ async def monitor(self):
return

if self._spawner.is_task_alive(runtime_task):
LOG.debug(
'Task "%s" is alive at monitor phase', runtime_task.task.identifier
)
async with self._state_machine.lock:
self._state_machine._monitored.append(runtime_task)
try:
Expand All @@ -414,16 +417,23 @@ async def monitor(self):
self._state_machine.monitored.remove(runtime_task)
except ValueError:
pass
else:
LOG.debug(
'Task "%s" was very short lived, this may be '
"completely normal depending on the task itself. "
"Please check the task logs",
runtime_task.task.identifier,
)

# from here, this `task` ran, so, let's check
# the its latest data in the status repo
# its latest data in the status repo
latest_task_data = (
self._state_machine._status_repo.get_latest_task_data(
str(runtime_task.task.identifier)
)
or {}
)
# maybe, the results are not available yet
# or maybe its results are not available yet
while latest_task_data.get("result") is None:
await asyncio.sleep(0.1)
latest_task_data = (
Expand Down

0 comments on commit 9d5c42f

Please sign in to comment.