Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suspend execution of tasks #6090

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

richtja
Copy link
Contributor

@richtja richtja commented Jan 15, 2025

This PR introduces the suspend execution feature to the nrunner. The
suspend execution was available on the legacy runner, but we didn't move
it to the nrunner. With this feature, it is possible to pause execution
of python based task on process spawner by sending SIGTSTP signal
(ctrl+z). It is helpful for debugging test execution.

Reference: #6059
Signed-off-by: Jan Richter [email protected]

@richtja richtja added this to the 110 - Codename TBD milestone Jan 15, 2025
@richtja richtja self-assigned this Jan 15, 2025
@richtja richtja marked this pull request as draft January 15, 2025 15:14
This is a refactoring of runners, which runs python scripts. It moves
most of the code related to running and monitoring processes into base
classes. This change removes duplicities across the runners, and it will
help with implementation of common features like signal handling.

Signed-off-by: Jan Richter <[email protected]>
This is a removal of legacy code for signal handling. This signal
handling was useful for the legacy runner where all tasks were running
in child processes. But now when we use spawners for creating tasks each
with different implementation, we need to handle the signal handling in
the spawners itself.

Signed-off-by: Jan Richter <[email protected]>
Copy link

codecov bot commented Jan 23, 2025

Codecov Report

Attention: Patch coverage is 90.41916% with 16 lines in your changes missing coverage. Please review.

Project coverage is 68.61%. Comparing base (670b97d) to head (852a64e).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
avocado/core/nrunner/runner.py 93.05% 5 Missing ⚠️
avocado/plugins/runners/sysinfo.py 71.42% 4 Missing ⚠️
avocado/core/task/statemachine.py 82.35% 3 Missing ⚠️
avocado/core/plugin_interfaces.py 50.00% 2 Missing ⚠️
avocado/plugins/spawners/process.py 83.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6090      +/-   ##
==========================================
- Coverage   68.66%   68.61%   -0.05%     
==========================================
  Files         203      203              
  Lines       21970    21964       -6     
==========================================
- Hits        15085    15071      -14     
- Misses       6885     6893       +8     

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

@richtja richtja force-pushed the runners_refactor branch 2 times, most recently from 31fa2ca to aeb256a Compare January 23, 2025 15:03
This change will spawn the new subprocess task into its own process
group. It will give us more control over the signal handling since the
signals won't be propagated to the subprocess any more.

Signed-off-by: Jan Richter <[email protected]>
This commit introduces the suspend execution feature to the nrunner. The
suspend execution was available on the legacy runner, but we didn't move
it to the nrunner. With this feature, it is possible to pause execution
of python based task on process spawner by sending SIGTSTP signal
(ctrl+z). It is helpful for debugging test execution.

Reference: avocado-framework#6059
Signed-off-by: Jan Richter <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review Requested
Development

Successfully merging this pull request may close these issues.

1 participant