Repository navigation
test: wait for the sidecars in the upgrade test - #61
Merged
Merged
Conversation
A sidecar's pod is ready before its server listens, and Pubgrade notifies a subscriber only once, so publishing right after the rollout sometimes missed a site. Wait until Pubgrade's pod reaches each sidecar at its callback URL first. Closes #58 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Give the test's sidecar a TCP readiness probe, so that its Service routes only once the server listens, bound the exec of the reachability check, and show its last error when it fails. Co-Authored-By: Claude Opus 5.5 <[email protected]>
uniqueg
marked this pull request as ready for review
November 6, 2026 06:03
Reviewer's GuideHarden the end-to-end upgrade test against startup races by adding sidecar readiness signaling and verifying that Pubgrade can reach every sidecar before publishing notifications, with bounded retries and actionable failure output. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #61 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 7 7
Lines 669 669
=========================================
Hits 669 669 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="tests/e2e/upgrade.sh" line_range="163" />
<code_context>
+try:
+ urllib.request.urlopen(sys.argv[1], timeout=5)
+except urllib.error.HTTPError:
+ pass # any response will do
+' "http://sidecar.${site}:8080/deployment/target" 2>&1 > /dev/null)"; then
+ return 0
</code_context>
<issue_to_address>
**Transient server errors pass readiness**
When the sidecar's callback endpoint returns a transient 5xx during startup, the `HTTPError` handler treats a 5xx as proof of reachability, so the script proceeds to publish while the sidecar is still failing requests. Pubgrade treats non-2xx callback responses as failed notifications, and the upgrade test sees the one-shot notification fail.
Treat 5xx responses as not ready and continue retrying, while allowing expected method or authentication errors to count as reachability.
</issue_to_address>Linked issues
#58 test: wait for the sidecars in the upgrade test · 1 of 1 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Before publishing, wait until Pubgrade can reach every sidecar through its Service, and fail clearly if it cannot within a bound. | ✅ Met | The test checks each site with wait_for_sidecar before publishing; the checks retry up to 60 times and report the last error on failure. |
Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: tests/e2e/upgrade.sh:163
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #58.
The upgrade test sometimes failed on a commit that had passed before (e.g. PR #56: run 42169573320 passed, 42169588369 failed on the same commit). Pubgrade notified a sidecar before its server listened, got a
ConnectionError, and notifies a subscriber only once, so that site never upgraded.wait_for_sidecarchecks that Pubgrade's pod reaches each sidecar at its callback URL, with a boundedkubectl exec(--request-timeout=20s), 60 tries 2 s apart, and the last error in the failure message.How it was verified
tests/e2e/upgrade.shlocally (kind, Helm 3.22): passes, before and after the review follow-up.🤖 Generated with Claude Code
Summary by Sourcery
Stabilize the end-to-end upgrade test by waiting for sidecars to be ready and reachable before triggering upgrades.
Bug Fixes:
Enhancements:
Tests: