Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions e2e/framework/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,8 @@ func (f *Framework) DevsySSHGpgTestKey(ctx context.Context, workspace string) er
}

func (f *Framework) DevsyPortTest(ctx context.Context, port string, workspace string) error {
// First run to trigger the first forwarding
_, _, err := f.ExecCommandCapture(ctx, []string{
"ssh",
"--forward-ports", port, workspace,
_, err := execWithSSHRetry(ctx, workspace, func(ctx context.Context) (string, string, error) {
return f.ExecCommandCapture(ctx, []string{"ssh", "--forward-ports", port, workspace})
})
return err
}
Expand Down
1 change: 1 addition & 0 deletions e2e/framework/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var retryableSSHPatterns = []string{
"no such container",
"connection timed out",
"broken pipe",
"workspace not found",
}

// isRetryableSSHError returns true when the error indicates a transient SSH
Expand Down
10 changes: 10 additions & 0 deletions e2e/framework/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ func TestIsRetryableSSHError_ConnectionTimedOut(t *testing.T) {
)
}

func TestIsRetryableSSHError_WorkspaceNotFound(t *testing.T) {
assert.True(
t,
isRetryableSSHError(
exitError(t, "1"),
"workspace not found for args: [/tmp/temp-XXXXXXX]",
),
)
}

func TestIsRetryableSSHError_ExitCode1_NoSSHPattern(t *testing.T) {
// Remote command failure (e.g. cat on missing file) — should NOT be retried.
assert.False(
Expand Down
Loading