Skip to content

Remote task monitoring#6308

Draft
pevogam wants to merge 3 commits into
avocado-framework:masterfrom
pevogam:remote-task-monitoring
Draft

Remote task monitoring#6308
pevogam wants to merge 3 commits into
avocado-framework:masterfrom
pevogam:remote-task-monitoring

Conversation

@pevogam
Copy link
Copy Markdown
Contributor

@pevogam pevogam commented May 29, 2026

No description provided.

pevogam added 3 commits May 22, 2026 23:13
Make more proper use of the avocado task state machine by detaching
from the task runner. This prevents the respective coroutine from
spending all the time at the task spawning stage instead of properly
monitoring the spawned task. While not fatal, the previous behavior
also led to "task ended too fast" warnings at the end of the long
task spawning wait where the task actually ended but definitely not
too fast.

While benevolent this change will be in need of some supporting
changes to provide enough resilience to the monitoring which come
next.

Signed-off-by: Plamen Dimitrov <plamen.dimitrov@intra2net.com>
A potential async yield due to slightly longer nonzero IO wait of
a forked command could result in the task only being logged as
"successfully spawned" after it is entirely complete if the other
coroutines spend too much time before coming back to this one. This
in turn would once again result in a "task ended too early" warning
all because it was revisited at a much later time. Worse yet, it
will also result in a skipped monitor stage where the task result
might be awaited indefinitely and any potential task timeout ignored.

Also make remote command running entirely in-sync so that even
though a drop at the call is highly unlikely (no IO waits), it will
now be fully prevented.

Signed-off-by: Plamen Dimitrov <plamen.dimitrov@intra2net.com>
There are observable cases where it might take a very short while
for the process to appear and thus the task be considered alive
so make sure the overall check makes at least a few tries within
a ten second window.
@mr-avocado mr-avocado Bot moved this to Review Requested in Default project May 29, 2026
@pevogam pevogam marked this pull request as draft May 29, 2026 11:35
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request replaces the asynchronous remote command execution with a synchronous implementation and introduces a synchronous retry loop with time.sleep in is_task_alive. The review feedback highlights that these synchronous calls will block the main asyncio event loop, freezing the application and preventing other concurrent tasks from progressing. It is highly recommended to keep these operations asynchronous.

Comment thread optional_plugins/spawner_remote/avocado_spawner_remote/__init__.py
Comment thread optional_plugins/spawner_remote/avocado_spawner_remote/__init__.py
@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2026

Codecov Report

❌ Patch coverage is 16.66667% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.04%. Comparing base (99bfac9) to head (1592cc5).
⚠️ Report is 70 commits behind head on master.

Files with missing lines Patch % Lines
.../spawner_remote/avocado_spawner_remote/__init__.py 16.66% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6308      +/-   ##
==========================================
- Coverage   73.60%   72.04%   -1.56%     
==========================================
  Files         206      206              
  Lines       22505    23354     +849     
==========================================
+ Hits        16565    16826     +261     
- Misses       5940     6528     +588     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Review Requested

Development

Successfully merging this pull request may close these issues.

1 participant