NO-JIRA: Replace blind sleep with TCP readiness checks in helm test setup#16689
NO-JIRA: Replace blind sleep with TCP readiness checks in helm test setup#16689stefanonardo wants to merge 1 commit into
Conversation
|
@stefanonardo: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
WalkthroughTest setup for helm actions replaces fixed 5-second sleeps with a new ChangesTCP Readiness Polling
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant TestSetup
participant waitForTCP
participant ChartMuseum
participant Zot
TestSetup->>waitForTCP: check localhost:port for ChartMuseum
waitForTCP->>ChartMuseum: DialTimeout("tcp", addr, 1s)
ChartMuseum-->>waitForTCP: connection success/failure
TestSetup->>waitForTCP: check localhost:port for Zot
waitForTCP->>Zot: DialTimeout("tcp", addr, 1s)
Zot-->>waitForTCP: connection success/failure
waitForTCP-->>TestSetup: ready or timeout error
Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 3 warnings)
✅ Passed checks (11 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sowmya-sl, stefanonardo The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test backend |
1 similar comment
|
/test backend |
|
/hold testing consistency in CI |
edd4633 to
6f7aee9
Compare
|
New changes are detected. LGTM label has been removed. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@pkg/helm/actions/setup_test.go`:
- Around line 200-211: In waitForTCP, replace the bare net.DialTimeout call with
a net.Dialer using a timeout and DialContext so the connection attempt is
cancellable via context and satisfies the noctx lint. Update the helper to
accept or derive a context, pass it into the dialer, and keep the timeout
behavior equivalent. Also handle the conn.Close result explicitly in the
successful path instead of discarding it, even if that just means checking and
surfacing any close error before returning.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: e62121c0-8231-48f0-a8c0-dab88182a1b0
📒 Files selected for processing (2)
pkg/helm/actions/setup_test.gopkg/helm/actions/testdata/downloadChartmuseum.sh
🚧 Files skipped from review as they are similar to previous changes (1)
- pkg/helm/actions/testdata/downloadChartmuseum.sh
|
/test backend |
2 similar comments
|
/test backend |
|
/test backend |
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6f7aee9 to
c81b61e
Compare
|
/test backend |
|
/unhold |
|
@stefanonardo: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
| conn.Close() | ||
| return nil | ||
| } | ||
| time.Sleep(time.Second) |
There was a problem hiding this comment.
Not a blocker.
Do we try each second? Or maybe 2-5 seconds each time?
|
duplicate #16687 |
Summary
The
ci/prow/backendjob fails intermittently becausesetupTestWithTls()uses a hardcodedtime.Sleep(5s)before connecting to ChartMuseum/Zot. In CI, under resource contention, the servers sometimes aren't ready within 5s. Replace all fourtime.Sleepcalls withwaitForTCP— a retry loop that polls the port with 1s intervals and a 30s timeout.Test plan
ci/prow/backendpassesSummary by CodeRabbit