Repository navigation
test(plugin): keep the back-to-back timeout test independent of machine load - #2886
Merged
Merged
Conversation
…ne load `python_plugins_back_to_back_after_a_timeout` ran three Python plugins under one 2-second wall-clock budget and expected only the two sleeping ones to exceed it. Under load the third (`error_plugin.py`) hit the budget too: with 64 CPU hogs on 16 cores it failed 5 runs out of 5, and a 6-second budget still timed it out once in three. The budget is now 15 seconds, about twice the worst seen, so the plugin expected to finish does. The naps sleep 600 seconds instead of 90, so they still exceed it, and the bound on the whole run (2 budgets plus a minute) stays well short of one nap's sleep, so a guest left running past its deadline still fails the test. The Python-presence assertion is unchanged. Under the same load it passed 20 runs out of 20. Closes #2879 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
✅ Compatibility Test Results
What's tested
Full results available in workflow artifacts |
Contributor
📊 Benchmark Results
vs base, measured in this run
A difference counts only when it clears the combined spread of the two measurements, per shape (2σ: What do these numbers mean?
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
plugin_conformance::python_plugins_back_to_back_after_a_timeout(test-only change, no behavior change):--plugin-max-time-secsis now 15 seconds instead of 2.nap.pyplugins sleep 600 seconds instead of 90.2 * budget + 60seconds (90), instead of 60. A const assertion keeps it below one nap's sleep.The assertions are unchanged:
python_ready()is still the Python-presence gate, which panics underRLEDGER_REQUIRE_PYTHON_WASI.Why
The budget is wall-clock and applies to every plugin, so
error_plugin.py, which is expected to finish, had to start CPython and run within 2 seconds. On a loaded machine it could not.The test still tests the timeout:
Verification
All of this ran on a 16-core machine.
Reproduced on the old test.
stress-ng --cpu 64gave a load average of 50 to 100. The test failed 5 of 5 runs, all three plugins reporting the 2-second budget error, which is the failure in the issue.Measured the finishing plugin alone under the same load, at various budgets:
A budget of 15 seconds leaves about twice the worst case seen.
Ran the new test under the same load. It passed 20 of 20 runs. Each run took 37 to 52 seconds against the 90-second bound, with a load average of 75 to 100 by the end.
Checks:
cargo test -p rustledger --all-featureswithRLEDGER_REQUIRE_PYTHON_WASI=1: all pass, no skip markers.cargo clippy -p rustledger --all-features --all-targets -- -D warningsRUSTDOCFLAGS=-Dwarnings cargo doc --workspace --no-depscargo fmt --checkCost
Unloaded, the test now takes about 35 seconds instead of about 5, because it waits out two 15-second budgets.
How to test
Closes #2879
🤖 Generated with Claude Code