Repository navigation
test: truncate_cleanup gets its pytest twin (#1341) - #1453
Conversation
jdatcmd
left a comment
There was a problem hiding this comment.
Approving d7cd0fe.
Measured on PG17: truncate_cleanup.sh 25/25; test_truncate_cleanup.py 25 checks over 6 tests. The tsv at this head is 3672 / 2696 / 976, matching its budget.
Your first mutant, run myself: the rewrite's pgcolumnar_delete_storage_tree(PgColumnarStorageId(rel)) removed. The shell is 18/25: every leak arm, starting with TRUNCATE returns the catalog to the empty baseline: got [1/0/1/2/4/2/0], and the projection arm got [2] want [0]. In pytest, 3 of 6 tests fail, ten cycles reaching 10/0/10/20/40/20/0. Your table says the same.
A note on the shell, not a blocker: under that mutant, the later shell arms' want is not zero (for example want [3/0/3/6/12/6/0]). They compare against a snapshot taken after the earlier arms' leak, so they measure the leak since the snapshot. They're still red. And pytest's private database (pgc_own_db) gives every test an absolute baseline, which is the stronger form.
I took the other three mutants from your table.
…es ALTER EXTENSION UPDATE (#1341 item 66) Between installing a new library and running ALTER EXTENSION pgcolumnar UPDATE, a database runs the 1.0-alpha5 library over its 1.0-alpha4 catalog. The library deletes from pgcolumnar.retired_group, which that catalog lacks, so DROP TABLE, TRUNCATE and pgcolumnar.vacuum() on a columnar table fail there with 42P01 'columnar metadata table "pgcolumnar.retired_group" does not exist', which names neither the cause nor the remedy. Measured: each refusal changes nothing, reads and writes work throughout, and after the update all three succeed on the same rows. open_columnar_table's error now carries a hint naming the update. docs/installation.md's "If you skipped step 3" shows the error and the hint. Red first, both twins, PG18: native_upgrade_converge gains the window's arms in a database at the previous release's catalog (the newest fixture), and the three refusal arms fail on main with `got [42P01|no-hint]`. test_native_upgrade_converge.py is their partial twin, declared INCOMPLETE; it stages the previous release's base script from test/fixtures as the shell does. Green on 15-19 in both twins. cluster_tests 660 -> 661 by collection; TESTS.md gets section 143. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… still be set to a row store (#1341) test_fk_referencing.py asserts every shell check by name; compare_to_bash grades it as covering all 28 (27 checks on PG17+, and the pre-17 branch's own), and it joins COMPLETE. The conversion guard's over-rejection control converted a table with no foreign key back to heap, so it could not see a guard that refused every SET ACCESS METHOD on a referenced table whatever the target: with the guard's columnar-target test removed, the suite stayed 26/26. A new arm sets the referenced table itself to heap; under that mutant both twins now fail it. cluster_tests 661 -> 666 by collection; TESTS.md gets section 144. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tations of the foreign-key guards (#1341) 28 rows from five-major runs (27/27 on 17-19, 26/26 on 15-16). Dated on PG18 by: the referenced-side refusal removed (5), the guard keyed on the referencing table (8), the conversion refusal removed (8), and the conversion refused whatever the target (1). suites_not_covered 219 -> 218; the census is 3647 rows, 2686 never, 961 dated, restated on main db56168. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_truncate_cleanup.py asserts every shell check by name; compare_to_bash grades it as covering all 25, and it joins COMPLETE. It runs in a private database, since the snapshot counts every pgcolumnar catalog row and the shared one holds every other test's. The shell suite needed no change: each of its arms already goes red under a mutation of the path it names. cluster_tests 666 -> 672 by collection; TESTS.md gets section 145. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…mutations of the truncate paths (#1341) 25 rows from five-major runs (25/25 on each of 15-19). Dated on PG18 by a rewrite that keeps the retired storage's rows (7) or its stale write state (1), an in-place truncate that skips the projections' storages (8), and a storage-tree delete that skips them (1). suites_not_covered 218 -> 217; the census is 3672 rows, 2695 never, 977 dated, restated on main db56168. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d7cd0fe to
50a8c31
Compare
jdatcmd
left a comment
There was a problem hiding this comment.
Re-approving 50a8c31, the restate onto main db56168. I compared every commit's patch with the approved stack using git range-diff. The test and source commits are unchanged, and the ledger-seed commits changed only by re-anchoring on #1470. The census at this head matches its budget paragraph, and the counts step consistently. At #1467's head: the guards pass (438), 687 collected (matching the file), and harness_selftest is 1245/1245.
#1341, the twin-less suites (the second of that item's list):
truncate_cleanup.shhad no pytest twin. This PR adds one, every check by the shell's name, and seeds the suite into the ledger. The shell needed no change. Each of its arms already goes red under a mutation of the path it names. Its comments record two arms that once passed on main and were fixed in review.Stacked on #1452, at the top of my chain (#1444 → #1446 → #1448 → #1450 → #1452). This branch is #1452's head plus two commits.
What changes
test/pytest/test_truncate_cleanup.py, the twin. It has six tests in a private database (pgc_own_db), since the snapshot counts every pgcolumnar catalog row, and the shared database holds every other test's.nontransactional_truncate.compare_to_bash.pygrades it as covering all 25 names, and it joinsCOMPLETE.truncate_cleanupis seeded with 25 rows from five-major runs, and 16 of the 25 rows dated.suites_not_coveredgoes 218 → 217, and the census is 3647 + 25 = 3672 rows, 2687 + 9 = 2696 never and 960 + 16 = 976 dated, matching the tsv. The gate gives rc=0 against origin/main.Red first
Each mutation of
src/columnar_tableam.cwas run one at a time on PG18, through both twins, with the.somd5 printed every time.truncate_cleanup.shtest_truncate_cleanup.pypgcolumnar_delete_storage_tree)got [1/0/1/2/4/2/0] want [0/0/0/0/0/0/0], ten cycles reaching10/0/10/20/40/20/0INSERT, TRUNCATE, INSERT in one transaction …:got [rc=0 -1..-1 n=0], a committed empty table:1323)row_group_pkey, and every arm after it goes red:1221)DROP of a loaded projected table leaves nothing:got [2/0/2/6/12/6/0]Never red (9):
Runs
truncate_cleanup.shtest_truncate_cleanup.pyAlso measured: the guard half (438 tests), harness_selftest 1245/1245 and docs_style.
cluster_testsgoes 666 → 672 by collection, and TESTS.md gets §145.🤖 Generated with Claude Code