Skip to content

stormtest: fix stale params starving bind_event/logs_read; log every abort reason (#634)#639

Merged
dsarno merged 2 commits into
mainfrom
fix/stormtest-harness-634
Jul 4, 2026
Merged

stormtest: fix stale params starving bind_event/logs_read; log every abort reason (#634)#639
dsarno merged 2 commits into
mainfrom
fix/stormtest-harness-634

Conversation

@dsarno

@dsarno dsarno commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #634. Two classes of problem in the stormtest harness, both found while reconciling error buckets during a live smoke.

1. Stale params starved two ops of coverage

  • op_input_map sent {"event_type": "key", "key": "A"} for bind_event, but the op requires keycode. 26/26 bind_event calls failed MISSING_REQUIRED_PARAM in a heavy run — zero real coverage.
  • op_logs drew source from ["plugin", "editor", "combined"]; "combined" is not a valid source (plugin|game|editor|all). ~50/148 logs_read calls failed ToolError, and the all path was never exercised.

Both fixed (keycode, all). Verified live: bind_event and logs_read now report 0 errors.

2. Silent aborts

Several early-exit paths set STOP[0] with no reason logged, so a truncated run gave no cause — a heavy run ended at 6115/~9000 calls with the summary literally saying "see log above for why" while the log said nothing. Every genuine abort now routes through a new _abort(reason) helper that prints the cause and sets a distinct ABORTED flag. STOP alone is also set by the normal end-of-run teardown and by a user Ctrl-C (SIGINT), so the report/JSON now distinguish:

  • clean finish → aborted: false, no "aborted early" line
  • early failure → aborted: true, !!! stormtest aborting: <reason> printed, reason named in the summary

Note on parallel work

A separate local session (spun off as a task chip during the smoke) began the two param-name edits but stopped without committing — its 2-line change sat uncommitted in a worktree. This PR includes those same two fixes plus the abort-logging (item 2 of #634), so it supersedes that unpushed work as the complete fix.

Testing

  • python -m py_compile + ruff check: clean.
  • Live short run (4 workers × 3 waves, reload off) against Godot 4.6.3: input_map_manage.bind_event 1/0, logs_read 9/0, final verdict EDITOR ALIVE, JSON stopped:false aborted:false.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of early test shutdowns so abort reasons are reported more clearly.
    • Final results now distinguish between a normal stop and an aborted run, with clearer messaging in the report.
    • JSON output now includes an explicit aborted status for easier result tracking.
    • Updated stress-test input values to better match current expectations (log source and event key name).

Two op generators sent parameter names the tools no longer accept, so
those paths always errored and got zero real stress coverage:
  - bind_event sent event_type=key with `key="A"`; the op requires
    `keycode`. 26/26 bind_event calls failed MISSING_REQUIRED_PARAM in a
    heavy run.
  - logs_read drew source from a list containing "combined", which is not
    a valid source (plugin|game|editor|all). ~35% of logs_read calls
    failed ToolError, and the `all` path was never exercised.

Separately, several early-exit failure paths set STOP[0] silently, so a
truncated run gave no reason — a heavy run ended at 6115/~9000 calls with
the summary pointing at "the log above", which said nothing. Route every
genuine abort through a new _abort(reason) helper that prints the cause
and sets an ABORTED flag distinct from STOP (which the normal end-of-run
teardown and a user Ctrl-C also set). The report and JSON snapshot now
distinguish a clean finish from an early abort and name the reason.

Closes #634

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f564fcf2-b63d-4332-8d57-8b28ec6da8d3

📥 Commits

Reviewing files that changed from the base of the PR and between 4dd3c0d and e2fd055.

📒 Files selected for processing (1)
  • script/stormtest.py

📝 Walkthrough

Walkthrough

Adds centralized early-abort tracking in script/stormtest.py, routes several failure paths through it, and updates JSON/human reporting to surface abort state. Also fixes two stress-operation parameter values.

Changes

Stormtest harness updates

Layer / File(s) Summary
ABORTED flag, _abort helper, and reporting
script/stormtest.py
Adds ABORTED state, centralizes abort handling in _abort(reason), writes aborted into the JSON snapshot, and prints an extra early-abort note in report().
Failure-path wiring to _abort
script/stormtest.py
Switches worker, reload, isolated reload, and health-monitor failure paths from direct STOP updates to _abort(...) calls with specific reasons.
Stress operation parameter fixes
script/stormtest.py
Updates op_logs to allow all sources and op_input_map to send keycode for bind_event.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Related issues: #634

Suggested labels: bug, testing, script

Suggested reviewers: maintainers familiar with script/stormtest.py

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main fixes: stale stormtest params and abort-reason logging.
Linked Issues check ✅ Passed The PR addresses both linked goals: it fixes bind_event/logs_read coverage and logs every early-exit reason.
Out of Scope Changes check ✅ Passed The extra report and aborted-state changes support the linked stormtest fixes and do not appear unrelated.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/stormtest-harness-634

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@script/stormtest.py`:
- Line 965: The verdict logic in the editor status check is using M["ok"], which
can cause aborted runs to still report the editor as alive after an earlier
successful tool call. Update the verdict calculation in the stormtest flow so it
keys off ABORTED[0] or the final liveness probe result instead of any prior
success, and keep the existing "EDITOR ALIVE"/"EDITOR DEAD/UNREACHABLE" symbols
consistent with the surrounding status handling.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 74358ecf-91d8-4b01-8925-b450ebafa8b6

📥 Commits

Reviewing files that changed from the base of the PR and between 54f53cd and 4dd3c0d.

📒 Files selected for processing (1)
  • script/stormtest.py

Comment thread script/stormtest.py Outdated
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

CodeRabbit review: the verdict used `not ABORTED[0] or M["ok"]`, so any
run with at least one earlier successful call reported "EDITOR ALIVE"
even if the editor was dead at the end — masking a real death behind
prior success.

Key the verdict off STOP[0] as it stands at report() time instead. In
concurrent mode main()'s final liveness probe sets STOP[0]=False when the
editor answers editor_state (True when unreachable); in isolated mode
STOP[0] stays False unless a path aborted. A mid-run abort the editor
recovered from now correctly reads ALIVE (it is alive at report time),
with the separate ABORTED line explaining the truncation.

Verified across all four (STOP, ABORTED, ok) combinations by driving
report() directly: prior-success + dead-final-probe now reports
DEAD/UNREACHABLE (previously ALIVE).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@dsarno

dsarno commented Jul 4, 2026

Copy link
Copy Markdown
Contributor Author

Addressed in e2fd055: the verdict now keys off the end-of-run liveness probe (STOP[0] at report time) instead of M["ok"], so prior successes no longer mask a dead editor. Verified across all four (STOP, ABORTED, ok) combinations — prior-success + dead-final-probe now correctly reports DEAD/UNREACHABLE.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the script/stormtest.py stress-test harness to (1) stop generating invalid/stale parameters that were causing input_map_manage.bind_event and logs_read calls to fail (and therefore not provide real coverage), and (2) ensure any early termination is explicitly logged with a clear abort reason and an aborted flag in the JSON snapshot.

Changes:

  • Fix stormtest-generated params to match current tool expectations (bind_event now uses keycode; logs_read now uses a valid source, including all).
  • Add a centralized _abort(reason) helper and ABORTED flag so every genuine early failure logs a reason and the report/JSON can distinguish “aborted early” from normal teardown / SIGINT.
  • Include aborted in the persisted report JSON and adjust the final verdict/report messaging accordingly.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@dsarno dsarno merged commit 9e1b2d2 into main Jul 4, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

stormtest harness: stale params starve bind_event and logs_read of coverage; STOP reason never logged

2 participants