From cf89aef04c34e8e5bdbb11332590a8188d2b0b90 Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 27 Jul 2026 16:31:32 -0500 Subject: [PATCH 1/2] Revert "fix(e2e): raise timeout for agent-socket cleanup (#786)" This reverts commit da6d6419d868d87f6198def8e9a82376a6c61d29. --- e2e/tests/ssh/agent_forward.go | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/e2e/tests/ssh/agent_forward.go b/e2e/tests/ssh/agent_forward.go index 613e7336d..214773bfc 100644 --- a/e2e/tests/ssh/agent_forward.go +++ b/e2e/tests/ssh/agent_forward.go @@ -233,17 +233,21 @@ var _ = ginkgo.Describe( closeCM() closed = true - // Per-poll budget must exceed a cold devsy ssh connection's - // setup, or the poll is killed mid-connect and returns empty. - gomega.Eventually(func() (string, error) { - pollCtx, cancel := context.WithTimeout(ctx, 30*time.Second) + // The cleanup hop traverses the devsy proxy → in-container + // SSH server's ctx.Done(), which can take several seconds + // under CI load. Each devsy ssh observation runs on a fresh + // connection so the just-closed socket's filesystem state is + // always up-to-date. + gomega.Eventually(func() string { + pollCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() - return f.DevsySSH( + out, _ := f.DevsySSH( pollCtx, tempDir, "test -S "+sockPath+" && echo PRESENT || echo GONE", ) - }).WithTimeout(90*time.Second).WithPolling(3*time.Second). + return out + }).WithTimeout(30*time.Second).WithPolling(500*time.Millisecond). Should( gomega.ContainSubstring("GONE"), "socket %s must be cleaned up after connection close", @@ -307,17 +311,19 @@ var _ = ginkgo.Describe( exitCmd.Env = append(os.Environ(), "SSH_AUTH_SOCK="+authSock) _ = exitCmd.Run() - // Assert no devsy-ssh-agent-* dirs remain after close. - gomega.Eventually(func() (string, error) { - pollCtx, cancel := context.WithTimeout(ctx, 30*time.Second) + // On a fresh devsy ssh connection, assert no devsy-ssh-agent-* + // directories remain. With lazy allocation, none are ever + // created; with the cleanup goroutine, any leftover is removed. + gomega.Eventually(func() string { + pollCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() - out, err := f.DevsySSH( + out, _ := f.DevsySSH( pollCtx, tempDir, "sh -c 'ls -d \"$XDG_RUNTIME_DIR\"/devsy-ssh-agent-* 2>/dev/null | wc -l'", ) - return strings.TrimSpace(out), err - }).WithTimeout(90*time.Second).WithPolling(3*time.Second). + return strings.TrimSpace(out) + }).WithTimeout(30*time.Second).WithPolling(500*time.Millisecond). Should( gomega.Equal("0"), "no devsy-ssh-agent-* dir must remain after a no-forward connection closes", From fc3bcf2e39a6b62f06cee7f81e502b74966fe1dc Mon Sep 17 00:00:00 2001 From: Samuel K Date: Mon, 27 Jul 2026 16:33:38 -0500 Subject: [PATCH 2/2] style: clean comments --- e2e/tests/ssh/agent_forward.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/e2e/tests/ssh/agent_forward.go b/e2e/tests/ssh/agent_forward.go index 214773bfc..47d2c1958 100644 --- a/e2e/tests/ssh/agent_forward.go +++ b/e2e/tests/ssh/agent_forward.go @@ -233,11 +233,6 @@ var _ = ginkgo.Describe( closeCM() closed = true - // The cleanup hop traverses the devsy proxy → in-container - // SSH server's ctx.Done(), which can take several seconds - // under CI load. Each devsy ssh observation runs on a fresh - // connection so the just-closed socket's filesystem state is - // always up-to-date. gomega.Eventually(func() string { pollCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel() @@ -311,9 +306,6 @@ var _ = ginkgo.Describe( exitCmd.Env = append(os.Environ(), "SSH_AUTH_SOCK="+authSock) _ = exitCmd.Run() - // On a fresh devsy ssh connection, assert no devsy-ssh-agent-* - // directories remain. With lazy allocation, none are ever - // created; with the cleanup goroutine, any leftover is removed. gomega.Eventually(func() string { pollCtx, cancel := context.WithTimeout(ctx, 5*time.Second) defer cancel()