You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
e2e: use wait.PollUntilContextTimeout in suite and ssh agent helper - #1515
Two hand-rolled time.Sleep poll loops in the e2e suite are replaced with wait.PollUntilContextTimeout from k8s.io/apimachinery/pkg/util/wait, the same helper already used by waitForRegistryReady in e2e/tests/snapshot/helper.go. Shared helper, same timeout and interval as before, no sleep loops left at these sites. Behaviour-preserving.
Changes
e2e/framework/ssh_agent.gowaitForAgentSocket: polls os.Stat(sockPath) every 25ms for up to 2s (immediate first check). Timeout error keeps its wording and now wraps the poll error with %w.
e2e/e2e_suite_test.goTestRunE2ETests, non-linux branch: polls DEVSY_AGENT_URL every 1s for up to 30s (immediate first check). t.Fatal message unchanged.
e2e/framework/ssh_agent_test.go (new): two unit tests for waitForAgentSocket. Socket appears shortly after the call returns nil; socket never appears returns an error. No assertions on sleep durations or log text.
CI jobs exercised
ssh-agent-forward (e2e/tests/ssh/agent_forward.go, calls StartMockSSHAgent): runs on ubuntu-latest on this PR.
up-provider-kubernetes (e2e/tests/up/provider_kubernetes_ssh_agent.go, calls StartMockSSHAgent): runs on ubuntu-latest on this PR.
Non-linux suite branch: no ubuntu CI row exercises it. Exercised locally on darwin: the root ./e2e/ ginkgo dry-run ran through the branch and enumerated 503 specs.
Local verification
go build ./e2e/...: pass
go vet ./e2e/framework/...: pass
go test ./e2e/framework/ -run 'TestWaitForAgentSocket|Ssh' -count=1: pass (both new tests)
ginkgo --dry-run ./e2e/: 503 of 503 specs, pass (via go run github.com/onsi/ginkgo/v2/ginkgo)
task cli:format: pass, no changes
task cli:lint:ci: 0 issues
gofmt -l e2e/: clean
Auto-merge
eligible: e2e/framework and e2e/e2e_suite_test.go only, no workflow files
Summary by CodeRabbit
Tests
Improved end-to-end test readiness checks by waiting for required services to become available, with a bounded timeout.
Added coverage for both delayed service availability and cases where a service does not become available.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Advanced
Run ID: ce3e741a-0ac2-4157-bb23-d5fe37f8a7f9
📥 Commits
Reviewing files that changed from the base of the PR and between 234b5f2 and 0639ceb.
📒 Files selected for processing: 3
e2e/e2e_suite_test.go
e2e/framework/ssh_agent.go
e2e/framework/ssh_agent_test.go
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
📝 Walkthrough
The E2E suite and SSH agent framework replace manual wait loops with Kubernetes context-aware polling. New tests cover successful and unsuccessful SSH agent socket waits.
Changes: E2E polling
Layer / File(s)
Summary
Agent URL polling e2e/e2e_suite_test.go
The suite checks DEVSY_AGENT_URL immediately, then polls at one-second intervals for up to 30 seconds. It fails if polling returns an error.
Agent socket polling and tests e2e/framework/ssh_agent.go, e2e/framework/ssh_agent_test.go
waitForAgentSocket checks immediately, then polls every 25 ms for up to two seconds. Polling errors are wrapped. Tests cover a socket that appears after a delay and a socket that remains absent.
The E2E readiness waits remain bounded and retain their stated success and failure behavior. No actionable merge-blocking risk is identified.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: replacing polling loops in the E2E suite and SSH agent helper with wait.PollUntilContextTimeout.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Fix all pre-merge checks with AI
✨ Finishing Touches
✨ Simplify code
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Two hand-rolled
time.Sleeppoll loops in the e2e suite are replaced withwait.PollUntilContextTimeoutfromk8s.io/apimachinery/pkg/util/wait, the same helper already used bywaitForRegistryReadyine2e/tests/snapshot/helper.go. Shared helper, same timeout and interval as before, no sleep loops left at these sites. Behaviour-preserving.Changes
e2e/framework/ssh_agent.gowaitForAgentSocket: pollsos.Stat(sockPath)every 25ms for up to 2s (immediate first check). Timeout error keeps its wording and now wraps the poll error with%w.e2e/e2e_suite_test.goTestRunE2ETests, non-linux branch: pollsDEVSY_AGENT_URLevery 1s for up to 30s (immediate first check).t.Fatalmessage unchanged.e2e/framework/ssh_agent_test.go(new): two unit tests forwaitForAgentSocket. Socket appears shortly after the call returns nil; socket never appears returns an error. No assertions on sleep durations or log text.CI jobs exercised
ssh-agent-forward(e2e/tests/ssh/agent_forward.go, callsStartMockSSHAgent): runs on ubuntu-latest on this PR.up-provider-kubernetes(e2e/tests/up/provider_kubernetes_ssh_agent.go, callsStartMockSSHAgent): runs on ubuntu-latest on this PR../e2e/ginkgo dry-run ran through the branch and enumerated 503 specs.Local verification
go build ./e2e/...: passgo vet ./e2e/framework/...: passgo test ./e2e/framework/ -run 'TestWaitForAgentSocket|Ssh' -count=1: pass (both new tests)ginkgo --dry-run ./e2e/: 503 of 503 specs, pass (viago run github.com/onsi/ginkgo/v2/ginkgo)task cli:format: pass, no changestask cli:lint:ci: 0 issuesgofmt -l e2e/: cleanAuto-merge
eligible: e2e/framework and e2e/e2e_suite_test.go only, no workflow files
Summary by CodeRabbit