Skip to content

[quality] test: pin the poller-to-thrash-breaker wiring end to end (src/pkg/agent pollTmuxOutputForAgent → checkBlockedThrash) - #6330

Open
kubestellar-hive[bot] wants to merge 1 commit into
v5from
quality/test-thrash-poller-wiring
Open

[quality] test: pin the poller-to-thrash-breaker wiring end to end (src/pkg/agent pollTmuxOutputForAgent → checkBlockedThrash)#6330
kubestellar-hive[bot] wants to merge 1 commit into
v5from
quality/test-thrash-poller-wiring

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Adds src/pkg/agent/thrash_poller_wiring_test.go with one end-to-end case, TestPollTmuxOutputForAgent_WiresThrashBreaker:

  • Seeds a real (hermetic-harness) tmux pane, starts pollTmuxOutputForAgent, waits for the first capture so the diff baseline exists.
  • Injects a burst of git push blocked: lines past the thrash threshold (5 in 60s).
  • Asserts the agent ends up paused with trigger thrash-breaker — the pause, not a log line.

Why: checkBlockedThrash/recordBlockedAndCheck are unit-tested, but the single call in the poller (manager_poll.go:244) that makes the breaker fire in production had no test — the exact #6147 shape (a correct breaker nothing invoked). A poller refactor could drop that line with every existing test still green.

Verification:

  • Passes on v5; ran -run 'Thrash|PollTmuxOutput' -count=3 — all green (~6.6s per run for the new test).
  • Mutation-checked: deleting the m.checkBlockedThrash call in the poller makes exactly this test fail.

Note: the test uses a 220-column tmux session — capture-pane returns wrapped display lines, and at 80 columns the marker wraps mid-word ("git push bl / ocked:"), invisible to the breaker's Contains match. That wrap-sensitivity of the marker match in production is recorded as a separate advisory bead.

Claimed ground: src/pkg/agent/thrash_poller_wiring_test.go (new file only); pins pollTmuxOutputForAgentcheckBlockedThrash wiring. Disjoint from open PRs #6328 (pkg/proxy), #6327 (pkg/hub), #6323 (docs), #6292 (claude write roots).

Related Issue

Fixes #6297
Refs #6147


Filed by quality agent (hold-gated mode). Human review required.

— hive: agent=quality backend=copilot model=claude-fable-5

Add TestPollTmuxOutputForAgent_WiresThrashBreaker in src/pkg/agent: drive a
burst of policy-blocked lines through pollTmuxOutputForAgent via a real tmux
pane and assert the agent ends up paused with trigger "thrash-breaker".

The breaker logic (checkBlockedThrash / recordBlockedAndCheck) was already
unit-tested; the one-line call site in the poller that fires it in production
was not — the exact #6147 shape. Mutation-checked: removing the call makes
this test fail.

The test creates a 220-column tmux session because capture-pane returns
wrapped display lines and an 80-column pane splits the blocked-action marker
mid-word, hiding it from the breaker's Contains match.

Fixes #6297
Refs #6147

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hive-quality <hive-quality@users.noreply.github.com>
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign danathar for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but carries no changelog entry
(no changelog.d/ fragment and no CHANGELOG.md edit).

If it is user-visible — a feature, a fix an operator would notice, a
security change, a migration, a deprecation, or anything breaking —
please add a fragment file changelog.d/<category>-<pr-or-slug>.md
containing exactly your entry (see changelog.d/README.md; the
category is one of added/changed/deprecated/fixed/security). Please
do not append to CHANGELOG.md's ## Unreleased directly — that
shared section is the merge-conflict generator fragments replaced
(#5675). If it is a refactor, a test-only change, or dependency
churn, no entry is needed and you can ignore this.

This is a reminder, not a gate; it never blocks a merge.

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

Labels

agent/quality Approved by a Hive merger/owner for auto-merge on green CI copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hive/hosted-available-oke-11-placeholder-r05x Approved by a Hive merger/owner for auto-merge on green CI hold no-changelog No changelog fragment required quality size/L Denotes a PR that changes 100-499 lines, ignoring generated files. testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants