Add retry logic to integration test catalog queries#690
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds retry logic to integration test helper functions that query PostgreSQL system catalogs to handle transient cache lookup failures that can occur during concurrent DDL operations.
Changes:
- Added new
ErrCacheLookupFailederror type for PostgreSQL XX000 internal errors containing "cache lookup failed" - Added comprehensive unit tests for PostgreSQL error mapping
- Updated
getTableConstraintsandgetTableIndexeshelper functions with retry logic using constant backoff
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| internal/postgres/errors.go | Added ErrCacheLookupFailed error type and mapping logic for XX000 errors with "cache lookup failed" message |
| internal/postgres/errors_test.go | Added comprehensive unit tests for error mapping, covering the new cache lookup failure case and existing error types |
| pkg/stream/integration/helper_test.go | Added retry logic with constant backoff to getTableConstraints and getTableIndexes functions; extracted SQL queries to constants; removed unused withoutGeneratedColumn constant |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
exekias
approved these changes
Jan 23, 2026
Merging this branch will increase overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
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.
Description
This PR updates the postgres integration test helper functions that query system catalogs. They can encounter transient cache lookup failures that can occur during concurrent DDL operations. Since the catalogs are queried immediately after a DDL operation, it's likely that they will hit this issue.
This can be observed in recent CI failures, where a retry resolves the issue.
Type of Change
Changes Made
Testing