[quality] deflake TestDeliverStartupKick_Delivered: gate readiness clock on actual pane render - #4875
Conversation
…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>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but does not touch If it is user-visible — a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
|
Thank you for your contribution! Your PR has been merged. Check out what's new:
Stay connected: Slack #kubestellar-dev | Multi-Cluster Survey |
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) callspaneInject(t, session, "goose is ready"), which types the marker into the tmux pane and sleeps a fixed 400ms, then immediately callsm.deliverStartupKick(...). InsidedeliverStartupKick, readiness is polled viawaitForCLIReadyForAgent, bounded by the TestMain-shrunkcliReadyTimeout. Under full-suite load (shared tmux server contention, ~282s forpkg/agentalone 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.waitForCLIReadyForAgentthen times out, the kick is (correctly) dropped, andagent.LastKickstays 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
requirePaneShowshelper already added in #4871 (tmux_coverage_test.go), which pollscapture-paneuntil the marker is visible (15s test-only deadline). This mirrors exactly the pattern #4871 used to deflake the sibling testTestDeliverStartupKick_BobReceivesKick. No production timeouts or delivery-path assertions change — the test still assertsagent.LastKickis set on a matching launch generation.Fixes #4865