test: fix whole cluster test for spock 5.0.7#383
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe test's replication validation is refactored to separate concerns: primary instances are validated via explicit sync-event waits, while replicas are verified through deadline-bounded polling loops. Imports are reordered for consistency. ChangesE2E Replication Validation Refactor
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@e2e/whole_cluster_test.go`:
- Around line 127-135: The polling loop around conn.QueryRow(...) sets synced
when actual == "test" but currently only sleeps on Scan error; modify the loop
so that when the query succeeds but actual != "test" it also sleeps (e.g., add a
time.Sleep(500*time.Millisecond) before continuing) to avoid tight spinning;
update the block containing variables synced, deadline, row :=
conn.QueryRow(...), and actual to perform the sleep when the comparison fails.
- Around line 11-12: Update the pgx dependency from v5.7.6 to v5.9.2 by running:
go get github.com/jackc/pgx/v5@v5.9.2 and then go mod tidy to update
go.mod/go.sum; keep using the same import "github.com/jackc/pgx/v5" in tests
(e.g., e2e/whole_cluster_test.go) and run the test suite including race
detection (go test -race ./...) to ensure the upgrade resolves the reported
issues.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a866839c-563f-4786-bbe8-494275aa1e1f
📒 Files selected for processing (1)
e2e/whole_cluster_test.go
`spock.wait_for_sync_event` no longer works properly on replica instances. This commit refactors the whole cluster test to only run this function on primary instances and to use polling to wait until the replica has caught up.
6e8e78a to
f5ca353
Compare
Summary
spock.wait_for_sync_eventno longer works properly on replica instances. This commit refactors the whole cluster test to only run this function on primary instances and to use polling to wait until the replica has caught up.Testing
# this test case works against any environment make test-e2e E2E_RUN=TestWholeCluster