Skip to content

[quality] deflake TestDeliverStartupKick_Delivered: gate readiness clock on actual pane render - #4875

Merged
clubanderson merged 1 commit into
v4from
fix/4865-startup-kick-flake
Aug 27, 2026
Merged

[quality] deflake TestDeliverStartupKick_Delivered: gate readiness clock on actual pane render#4875
clubanderson merged 1 commit into
v4from
fix/4865-startup-kick-flake

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Root cause

Same root cause as #4871, on the sibling test that PR didn't touch.

TestDeliverStartupKick_Delivered (src/pkg/agent/branches_coverage_test.go) calls paneInject(t, session, "goose is ready"), which types the marker into the tmux pane and sleeps a fixed 400ms, then immediately calls m.deliverStartupKick(...). Inside deliverStartupKick, readiness is polled via waitForCLIReadyForAgent, bounded by the TestMain-shrunk cliReadyTimeout. Under full-suite load (shared tmux server contention, ~282s for pkg/agent alone per the issue), tmux can take longer than 400ms to actually paint the marker, so the readiness clock starts before the pane has rendered it. waitForCLIReadyForAgent then times out, the kick is (correctly) dropped, and agent.LastKick stays nil — failing an assertion unrelated to the delivery logic under test.

Fix

Gate the readiness clock on the actual pane render instead of the fixed sleep, using the requirePaneShows helper already added in #4871 (tmux_coverage_test.go), which polls capture-pane until the marker is visible (15s test-only deadline). This mirrors exactly the pattern #4871 used to deflake the sibling test TestDeliverStartupKick_BobReceivesKick. No production timeouts or delivery-path assertions change — the test still asserts agent.LastKick is set on a matching launch generation.

Fixes #4865

…ock on actual pane render

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>
@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

@kubestellar-prow kubestellar-prow Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 27, 2026
@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.

@clubanderson
clubanderson merged commit 2f793d4 into v4 Aug 27, 2026
39 of 40 checks passed
@clubanderson
clubanderson deleted the fix/4865-startup-kick-flake branch August 27, 2026 12:30
@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

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

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[quality] Flaky test: TestDeliverStartupKick_Delivered fails under full-suite load

1 participant