test: add differential query compatibility oracle - #84
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b98b0547c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| syncProcess := startProcess(t, binary, syncArgs...) | ||
| t.Cleanup(syncProcess.kill) |
There was a problem hiding this comment.
Stop sync before deferred slot cleanup
If this target fails after the sync process starts but before the explicit stop, this t.Cleanup runs only after runTargetCompatibility's deferred cleanupSource; the slot is therefore still active when cleanup filters on active = false, so it is left behind while its publication is removed. Because every run uses a new slot name and the test Postgres permits only four replication slots, repeated failed local runs can exhaust all slots and prevent subsequent tests from starting. Arrange process termination to run before the database cleanup on every exit path.
Useful? React with 👍 / 👎.
Summary
Add a purpose-built differential query compatibility harness that treats source Postgres as the oracle and compares it with Streambed through the actual Postgres-wire endpoint.
The suite runs the same deterministic fixture and query matrix against both Iceberg and DuckLake targets. It compares query behavior, column names, Postgres OIDs, nulls, row multiplicity, ordering, and type-aware values.
Closes #78.
Implementation
test/querycompatwith a deterministic Postgres fixture and declarative query cases.scripts/test-integration.sh.Compatibility findings fixed
Running the oracle against real services exposed three correctness issues that are fixed here:
standard_conforming_strings=onso pgx can use the simple query protocol.timestampto Parquet withisAdjustedToUTC=false, while retainingtruefortimestamptz; this prevents local timezone shifts when Iceberg is queried.Known storage-type differences remain explicitly classified for numeric, unconstrained numeric, varchar, JSONB, and Iceberg smallint mapping.
Validation
Started fresh Postgres and MinIO containers, built Streambed, synced the fixture separately to Iceberg and DuckLake, started the Streambed query server, and compared every query through pgwire:
docker compose -f test/integration/docker-compose.yml down -v docker compose -f test/integration/docker-compose.yml up -d postgres minio --wait docker compose -f test/integration/docker-compose.yml up createbucket go test -tags integration -v -count=1 -timeout 10m ./test/querycompatResult: PASS for Iceberg and DuckLake.
Also ran: