Skip to content

[quality] deflake TestDeliverStartupKick_BobReceivesKick: gate readiness clock on actual pane render - #4871

Merged
clubanderson merged 1 commit into
v4from
quality/test-bobkick-pane-render
Aug 27, 2026
Merged

[quality] deflake TestDeliverStartupKick_BobReceivesKick: gate readiness clock on actual pane render#4871
clubanderson merged 1 commit into
v4from
quality/test-bobkick-pane-render

Conversation

@kubestellar-hive

Copy link
Copy Markdown
Contributor

Test Improvement

Test-only change, scoped to two files:

  • src/pkg/agent/tmux_coverage_test.go — new requirePaneShows helper: polls capture-pane until the expected text is actually visible in the session's pane (15s test-only deadline), failing with the last capture on timeout.
  • src/pkg/agent/bob_startup_kick_test.goTestDeliverStartupKick_BobReceivesKick now calls requirePaneShows(t, session, bobInputPlaceholder) after paneInject and before deliverStartupKick.

Why: paneInject types the placeholder and sleeps a fixed 400ms; the test then enters deliverStartupKick, whose readiness poll is bounded by the TestMain-shrunk cliReadyTimeout = 5s. Under load, tmux paints slower than that, waitForCLIReadyForAgent times out, and the kick is (correctly) dropped — flaking the test (observed 2 failures in 4 full-package runs, failing at 5.56s ≈ timeout + capture). Gating the readiness clock on the actual render removes the race without widening any production timeout the test exercises.

Validation: go vet ./pkg/agent/ clean; go test -count=3 -run TestDeliverStartupKick ./pkg/agent/ all pass.

Disjointness: does not touch activity_collector_test.go (#4864), dashboard/audit.go (#4863), or any proxy/auth-injection file (#4032).

Related Issue

Fixes #4869


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

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

…ess clock on actual pane render

paneInject types the bob placeholder and sleeps a fixed 400ms; the test
then enters deliverStartupKick, whose readiness poll is bounded by the
TestMain-shrunk cliReadyTimeout=5s. On a loaded runner tmux paints slower
than that, waitForCLIReadyForAgent times out, and the kick is (correctly)
dropped — failing the test for reasons unrelated to the delivery path it
pins. Observed 2 failures in 4 full-package runs.

Add requirePaneShows (tmux_coverage_test.go), which polls capture-pane
until the marker is actually visible (15s test-only deadline), and call
it in TestDeliverStartupKick_BobReceivesKick before delivering the kick.
Production timeouts under test are unchanged.

Refs #4869

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: hive-quality[bot] <hive-quality[bot]@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Aug 27, 2026
@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 clubanderson 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

@github-actions

Copy link
Copy Markdown
Contributor

Changelog: this PR changes code but does not touch CHANGELOG.md.

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 line under ## Unreleased. 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.

@kubestellar-prow kubestellar-prow Bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 27, 2026
@clubanderson
clubanderson merged commit da0bf24 into v4 Aug 27, 2026
39 of 40 checks passed
@clubanderson
clubanderson deleted the quality/test-bobkick-pane-render branch August 27, 2026 12:18
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

Check out what's new:

Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey

clubanderson added a commit that referenced this pull request Aug 27, 2026
…ock on actual pane render (#4875)

paneInject types the goose-is-ready marker and sleeps a fixed 400ms;
the test then enters deliverStartupKick, whose readiness poll is
bounded by the TestMain-shrunk cliReadyTimeout. On a loaded runner
tmux paints slower than that, waitForCLIReadyForAgent times out, and
the kick is (correctly) dropped, failing the test for reasons
unrelated to the delivery path it pins. Same root cause and pattern
as the sibling test TestDeliverStartupKick_BobReceivesKick fixed in
#4871.

Call the existing requirePaneShows helper (tmux_coverage_test.go)
before delivering the kick so the readiness clock only starts once
the marker is actually visible in the pane. Production timeouts under
test are unchanged.

Refs #4869

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

copilot dco-signoff: yes Indicates the PR's author has signed the DCO. hold size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

1 participant