Skip to content

fix(e2e): raise timeout for agent-socket cleanup - #786

Merged
skevetter merged 2 commits into
mainfrom
frantic-walrus
Jul 27, 2026
Merged

fix(e2e): raise timeout for agent-socket cleanup#786
skevetter merged 2 commits into
mainfrom
frantic-walrus

Conversation

@skevetter

@skevetter skevetter commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

The e2e spec "socket directory is cleaned up after connection close" was failing in CI with an empty observed value (not PRESENT):

Expected
    <string>:            ← empty
to contain substring
    <string>: GONE

Root cause

The cleanup assertion polls a fresh devsy ssh connection under a 5s per-attempt context (agent_forward.go). A cold connection's tunnel + container-exec setup routinely approaches ~4s locally and exceeds 5s under CI load, so the poll's context kills the devsy ssh process mid-connect (signal: killed) and DevsySSH returns an empty string. The Eventually discarded that error and matched on empty output, so it never observed GONE and timed out at ~30s.

The socket itself was cleaned up promptly — the connection-closing callback fires on transport EOF from a clean ssh -O exit. This was verified end-to-end locally against Docker (OrbStack): with unmodified production code the socket was GONE on the first poll at +3.1s. Tightening the poll budget to 2s reproduced the exact CI empty-output symptom, confirming the diagnosis.

Fix

Test-only. Raise the per-poll context to 30s (outer window 90s) so a cold connection can complete, and surface the poll error instead of discarding it — so a genuine socket leak or a persistent connection failure fails loudly rather than timing out on empty output. Applied to both the cleanup spec and the no-forward-cleanup spec.

No production code changes; #760's keep-alive tolerance is untouched.

Verification

  • Full agent-forward label suite (5 specs) passes locally against Docker.
  • pkg/ssh/server unit tests pass.

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for images-devsy-sh canceled.

Name Link
🔨 Latest commit 0b23a16
🔍 Latest deploy log https://app.netlify.com/projects/images-devsy-sh/deploys/6a67b7272e27b20008b88cfe

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@skevetter, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e3012f2-4be5-4ed3-8b73-36e5f82da15f

📥 Commits

Reviewing files that changed from the base of the PR and between 6fbcdfd and 0b23a16.

📒 Files selected for processing (1)
  • e2e/tests/ssh/agent_forward.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@netlify

netlify Bot commented Jul 27, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 0b23a16
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a67b727dee3c600085d7d8f

The "socket directory is cleaned up after connection close" spec (and the
no-forward variant) polled a fresh `devsy ssh` connection under a 5s
per-attempt context. A cold connection's tunnel + container-exec setup
routinely approaches ~4s locally and exceeds 5s under CI load, so the poll
process was killed mid-connect and DevsySSH returned an empty string. The
Eventually discarded the error and matched on empty output, so it never
observed GONE and timed out at ~30s — even though the socket had already
been cleaned up promptly (~3s, verified locally against Docker).

Raise the per-poll context to 30s (outer window 90s) so a cold connection
can complete, and surface the poll error instead of discarding it so a
genuine leak or persistent connection failure fails loudly rather than
timing out on empty output.
@github-actions github-actions Bot added size/s and removed size/l labels Jul 27, 2026
@skevetter skevetter changed the title fix(ssh): reap idle agent-forward connections after client vanishes fix(e2e): unflake agent-socket cleanup polls (too-tight per-poll budget) Jul 27, 2026
@skevetter skevetter changed the title fix(e2e): unflake agent-socket cleanup polls (too-tight per-poll budget) fix(e2e): raise timeout for agent-socket cleanup Jul 27, 2026
@skevetter
skevetter marked this pull request as ready for review July 27, 2026 20:33
@skevetter
skevetter merged commit da6d641 into main Jul 27, 2026
66 checks passed
@skevetter
skevetter deleted the frantic-walrus branch July 27, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant