Repository navigation
Conversation
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
An optional, opt-in property-based testing (PBT) layer for PostgreSQL built on the Hegel engine (libhegel), living entirely under
src/test/prop. Off by default, gated on three conditions (explicit configure flag--with-hegel/-Dprop_tests=enabled, the engine being present, and TAP tests enabled); if any piece is missing under the opt-in flag it is a hard configure error, and with the flag off nothing changes.This is a large series (one commit per area) opened primarily so CI runs the suite. Nothing in the server is modified; this only adds a test tree plus the build plumbing to wire it in.
What's here
pg_prop.c/.h,pg_prop_sql.c): a small plain-C wrapper over libhegel's C ABI, aPG_PROP()registry, TAP output, a fork-basedisolate()for code that may crash, and libpq oracle helpers. CLI:pg_prop <area> [-n iters] [-s seed] [property ...].t/001_prop.pl, 12 areas: path, jsonapi, encoding, unicode_case/norm, pglz, base64, prng, crypto, scram, binaryheap, bitutils). Tier B drives SQL against a live node via libpq (t/002_sql_props.pl, ~246 areas).src/test/prop/sql/): a shared random-table + predicate generator feeding metamorphic oracles that test the planner and executor rather than individual functions:query_tlp,query_tlp_agg,query_tlp_distinct-- Ternary Logic Partitioning (rows, aggregates, DISTINCT/set-ops)query_norec-- non-optimizing reference, including across a joinquery_cardinality-- result-size monotonicity lawsquery_pqs-- Pivoted Query Synthesis (single query vs single known-true fact)query_planadvice-- the same query run free vs steered viacontrib/pg_plan_advice(scan/join method, join order, merge join, spill); result must not depend on the chosen planquery_gen.setup/column/predicate), after which every query-level oracle covers that type with no new oracle code.sql/prop_query_ext_citext.cis a complete worked example.Validation
Full TAP suite green on a cassert build: 12 Tier-A + 246 Tier-B subtests, zero warnings, run under the TAP driver's own seed stream. On a branch-coverage build the query-level areas drive real planner/executor coverage (e.g.
clausesel.c~72% branches; a single plan-advice property tooknodeMergejoin.cfrom 0% to ~30% branches).See
src/test/prop/READMEandsrc/test/prop/DESIGNfor the full rationale, the when-to-use/when-not guidance, the measured coverage story, and the extension mechanism.No server bug is fixed or reported here; findings surfaced during development are property/oracle-soundness issues recorded out of tree.