Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2866 +/- ##
==========================================
+ Coverage 61.31% 61.35% +0.04%
==========================================
Files 499 499
Lines 50326 50390 +64
Branches 8835 8852 +17
==========================================
+ Hits 30855 30917 +62
- Misses 18628 18633 +5
+ Partials 843 840 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
Critical workflow and swap-protection issues, along with moderate test and cleanup issues, remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds selectable single-memory-stressor execution for stress-ng, including CLI support, test plans, jobs, and a launcher.
Changes:
- Adds
--stressorand--list-stressors. - Adds resource/template jobs and a single-stressor test plan.
- Adds the certification launcher and unit tests.
File summaries
| File | Change | Review findings |
|---|---|---|
providers/certification-server/launcher/test-memory-stressor |
Adds the user-facing launcher. | Nit (1 vote): document the launcher in the certification-server man page. |
providers/base/units/stress/test-plan.pxu |
Adds the single-stressor test plan. | Critical (1 vote): include watchdog lifecycle jobs and ordering metadata. Nit (2 votes): correct the misleading exactly-one selection description. |
providers/base/units/stress/stress-ng.yaml |
Defines resource and templated stressor jobs. | Critical (3 votes): provide and align the minimum-swap environment variable so configured swap protection is applied. |
providers/base/tests/test_stress_ng_test.py |
Tests stressor discovery and execution. | Moderate (3 votes): reorder patched mock arguments. Moderate (1 vote): add coverage for vm, stack, timeouts, and thread counts. |
providers/base/bin/stress_ng_test.py |
Implements stressor listing and single-stressor execution. | Moderate (2 votes): clean up temporary swap when an unknown stressor is supplied. |
Review details
Suppressed comments (2)
providers/base/tests/test_stress_ng_test.py:243
- This test exercises only the
matrixconstant-runtime branch and checks only the return code. The newly addedvmandstackpaths choose different timeouts and thread counts, so a regression in those settings would still pass; add assertions/cases for the variable-runtime and low-thread-count stressors.
["stress_ng_test.py", "memory", "--stressor", "matrix"],
)
def test_main_stress_memory_single_stressor(
self,
shutil_which_mock,
providers/certification-server/launcher/test-memory-stressor:1
- This adds a user-facing installed launcher, but
providers/certification-server/debian/canonical-certification-server.rststill omitstest-memory-stressorfrom the documented subset commands; it liststest-memoryandtest-stressinstead. Add the new entry point to the man page so the feature is discoverable.
#!/usr/bin/env checkbox-cli
- Files reviewed: 4/5 changed files
- Comments generated: 4
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| requires: | ||
| - executable.name == 'stress-ng' | ||
| estimated_duration: '300.0' | ||
| command: systemd-inhibit stress_ng_test.py memory --stressor {stressor} |
| include: | ||
| stress/memory_stressor_stressor | ||
| bootstrap_include: | ||
| memory_stress_ng_stressors | ||
| executable |
6beaa67 to
2a1fbab
Compare
Introduce the capability to run individual memory stressors via a new
`--stressor` flag in `stress_ng_test.py`.
To support this in the test framework:
- Add `memory_stress_ng_stressors` resource job and a single-stressor
template job (`stress/memory_stressor_{stressor}`).
- Add `--list-stressors` flag to expose available stressors
- Move the `--list-stressors` dispatch prior to root and `stress-ng`
binary checks so unprivileged resource discovery jobs do not fail.
- Add `memory-single-stressor` test plan and `test-memory-stressor`
launcher to allow picking specific stressors from the selection menu.
Fixed Black Formatting
Cover the vrt/ltc single-stressor timeout branches, the single- stressor temporary swap cleanup path, explicit --oom-avoid-bytes, and the >255GiB RAM 5% OOM-avoidance branch, none of which were exercised by the existing test suite.
2a1fbab to
f663191
Compare
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Description
This also allow the running of a subset of memory stressors
Resolved issues
In some instances it can take days or a week or two to run memory stress-ng for systems with a lot of RAM. This helps with debugging single stressors that fail.
Documentation
Tests
Install canonical-certification-server
Run the launcher test-memory-stressor
Select 1 or several stressors
Run