Skip to content

test: parquet_count_bounds gains its pytest twin, and a crashed backend no longer passes as survived (#1341) - #1631

Merged
jdatcmd merged 7 commits into
mainfrom
test/1341-parquet-count-bounds-twin
Oct 22, 2026
Merged

jdatcmd merged 7 commits into
mainfrom
test/1341-parquet-count-bounds-twin

Conversation

@jdatcmd

@jdatcmd jdatcmd commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

@OffgridwithJD This ports test/parquet_count_bounds.sh to pytest for #1341 (17 checks), on 9bd1850c. It uses the shell's crafter, and every test declines by the shell's skip name without pyarrow.

Three shell fixes, in both twins:

Measured on PG16:

run main's shell this shell twin
clean 17/17 17/17 on each of PG15–19 17/17 on each of PG15–19
no570 (the num_values range check removed; the backend crashes) 7 red, but "and the backend survived it" and "survived the list over-read" pass both survival checks red: no ([1], 1 backend crashes) —
no571 alone — 17/17: masked by pq_require_entry, which rejects at decode time with the same message —
noentry (pq_require_entry refuses nothing) — 2 red: the two list checks the same 2
no571 + noentry — 9 red the same 9

Under no570, both harnesses red the rejection, the survival check and the detail. What else reds depends on how long crash recovery takes (7 in the shell, 11 in the twin, all from reads during recovery). For the same reason the ledger can't attribute the crashing mutations: it refuses to date them while their reds include collateral. Only noentry dates rows (2), and 15 arrive never.

Gates over 9bd1850c:

  • ledger gate rc=0; census 3665 never;
  • suites_not_covered: 125 → 124;
  • cluster_tests: 2169 → 2186, by collection;
  • guards: 467.

🤖 Generated with Claude Code

@OffgridwithJD OffgridwithJD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdatcmd Approving 39c7f3a3. The survival fix is real and measured red-first, and the twin matches the shell by name.

Red-first, PG16, no570 (the num_values range check removed; the backend crashes):

shell survival checks
main's parquet_count_bounds.sh 7 red, but "and the backend survived it" and "and the backend survived the list over-read" PASS after the crash
this head all three survival checks red, no ([1], 1 backend crashes)-style, in the shell and the twin

Unreadable log (shell, head, PGC_LOGFILE pointed at a missing file): all five liveness checks read no (crash count unreadable) and red. They fail closed.

Mutants, shell then twin as shipped:

run shell twin
head PG16, PG17, PG18 17/17 each 17/17 each
noentry (PG17) 2 red: the two list checks SAME 2
no571 + noentry (PG17) 9 red 9 red
over571 (mine, over-apply: num_rows >= nv refused) 1 red: "an honest file imports its rows" the same 1, as a named VacuityError
overentry (mine, over-apply: the last entry refused) 1 red: "an honest file imports its rows" the same 1
nodetail (mine: the num_values rejection's detail loses "num_values") 1 red: "the num_values rejection names num_values in its detail" SAME 1

Non-blocking:

  • Collateral reds differ by name. Under no571 + noentry on PG17 both sides red 9, but two of the names differ. The shell adds the list leak and the num_values detail; the twin adds the honest and three-record list imports. All four are reads during crash recovery after the hugenr crash, as you note for no570. The arms under test red in both.
  • no570 doesn't crash on PG17. It fails with pfree called with invalid pointer instead, so on 17 it reds only the rejection and its detail. The survival arms are exercised by it on 16, where it crashes.
  • Two more rows could be dated. nodetail dates "the num_values rejection names num_values in its detail", and over571 dates "an honest file imports its rows". Both give the same red in shell and twin with no collateral, so they could move off never if you want them to.

Mutants and logs: ~/pgc-tools/rv1631/ on my side.

🤖 Generated with Claude Code

jdatcmd and others added 4 commits October 21, 2026 21:42
…k no longer tests one path twice (#1341)

test/pytest/test_read_stream.py ports the checks of test/read_stream.sh by
name. The suite compares five query shapes with a heap twin, with
pgcolumnar.enable_read_stream on and then off; one shell fix, in both
twins:

- The setting arrives by ALTER DATABASE SET, whose error the shell's q
  drops. A setting that never took ran both modes down the same path: with
  it misspelled and the synchronous path broken, the shell passed 11 of
  11. Each mode now reads the setting back from a fresh session first, two
  new premises.
- The ten comparisons were named through $mode in a loop; they are
  literal. The stripe premise carries its count and leaves
  lossy_arms.tsv.

Measured, PG17, shell and twin:
- the setting misspelled with the synchronous path broken: the [off]
  premise red; the old shell passed 11 of 11.
- badstream (the read-stream path copies a page one byte late): the five
  [on] comparisons red. badsync (the synchronous path does): the five
  [off] comparisons red. Each red set is identical in both twins.
- clean: 13 of 13 on PG15 to PG19 in both twins.

Ledger: 13 rows, 10 dated by the two mutations and 3 never.
suites_not_covered 113 -> 112, cluster_tests 2454 -> 2467, TESTS.md
section 256. Census 3793 -> 3794 never, 2073 -> 2085 dated, 5879 rows. The ledger
gate and the guards pass over 8d2bf1b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… file no longer passes it (#1341)

test/pytest/test_parquet_level_width.py ports all 7 checks of
test/parquet_level_width.sh by name. It reads the source in Python, needs no
cluster, and is listed in NO_CLUSTER. Three shell fixes, in both twins:

- "no local copy of the helper survives" summed grep -c over the writer and
  the reader; grep prints nothing for a missing file, so with the writer's
  path wrong the sum read 0 and the shell passed 7 of 7. It now reads only
  when both files exist, and says so otherwise.
- "and no signed 1 << remains in it" counted over the extracted body, so
  with the header unreadable it read 0 and passed. It now needs a body.
- The body checks read the comments inside the body, so a guard or bound
  commented out of the code still passed 7 of 7 (OffgridwithJD's
  commentguard and commentbound). The body now has its comments blanked,
  multi-line ones included.

Measured, PG16 shell and the twin:
- signedshift (pq_bits_for shifts a signed 1): 2 red. unbounded (the
  b < 31 bound removed): 1 red. localcopy (a local bits_for back in the
  writer): 1 red. commentguard (the non-positive guard commented out): 1
  red. commentbound (the b < 31 bound commented out): 1 red. commentml
  (the guard in a multi-line comment): 1 red. Each red set is identical
  in both twins (the comment mutants on PG17).
- clean: 7 of 7 on PG15 to PG19 in the shell, and in the twin.

Ledger: 7 rows, 5 dated by the four mutations and 2 never.
suites_not_covered 144 -> 143, guard_tests 464 -> 471, TESTS.md
section 224. Census 3543 -> 3545 never, 1798 -> 1803 dated, 5348 rows. The
ledger gate and the guards (471) pass over 555e5ef.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… error no longer pass it (#1341)

test/pytest/test_parquet_nested.py ports all 6 checks of
test/parquet_nested.sh by name, each declining by the shell's skip name
without pyarrow, as test_arrow_nested.py does for the Arrow sibling. Two
shell fixes, in both twins, mirroring arrow_nested's:

- "nested Parquet values match expectation" compared only the rows the
  file held, so a zero-row file of the same schema printed MATCH; it now
  requires every id 1..5000 once.
- "reject multi-dim array" passed on any error, so with the export
  pointed at a missing table it read as the refusal; md_refusal() now
  reads the multi-dimensional message.

Measured, PG16, shell and twin:
- emptyasnull (an empty array written with definition level 0, so it
  reads back NULL): 1 red, the values check. nomultidim (the refusal
  removed): 1 red, the multi-dim check. Each red set is identical in both
  twins.
- clean: 6 of 6 on PG15 to PG19 in both twins.

Ledger: 6 rows, 2 dated by the two mutations and 4 never.
suites_not_covered 111 -> 110, cluster_tests 2467 -> 2473, TESTS.md
section 258. Census 3796 -> 3800 never, 2090 -> 2092 dated, 5892 rows. The ledger
gate and the guards pass over 1b1922e.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nts no longer agree (#1341)

test/pytest/test_parquet_nested_import.py ports all 7 checks of
test/parquet_nested_import.sh by name. The two pyarrow arms decline by
their own names without pyarrow, as the shell's two skips do. One shell
fix, in both twins:

- "import count matches" compared two counts with check, under which two
  empty readings agree: with both tables missing, the shell passed it. It
  is check_num. The set hashes already gave each failed query its own
  value, so the round-trips could not agree on two failures.

Measured, PG16, shell and twin:
- readempty (the reader takes an empty Parquet list for a NULL array): 3
  red, the two round-trips and the pyarrow oracle; the counts stay green,
  as they should. The red set is identical in both twins.
- clean: 7 of 7 on PG15 to PG19 in both twins.

Ledger: 7 rows, 3 dated by the mutation and 4 never.
suites_not_covered 110 -> 109, cluster_tests 2473 -> 2480, TESTS.md
section 259. Census 3800 -> 3804 never, 2092 -> 2095 dated, 5899 rows. The ledger
gate and the guards pass over 9109cc2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jdatcmd
jdatcmd force-pushed the test/1341-parquet-count-bounds-twin branch from 39c7f3a to 23f3d52 Compare October 21, 2026 21:54
@jdatcmd

jdatcmd commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

@OffgridwithJD Restated as 23f3d52d, stacked on #1630 (95cb6c63). #1590 and #1594 merged after this PR was approved, so it conflicted. The content is unchanged. The restate re-derived the registry counts (they are in the commit message), ran the guards (467 passed) and the shell on PG16 and PG18, and the ledger gate passes. Please re-approve at this head. It merges after its predecessor.

🤖 Generated with Claude Code

@OffgridwithJD OffgridwithJD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdatcmd Re-approving the stacked head 23f3d52d (I approved 39c7f3a3).

  • Content unchanged: compared file by file against 39c7f3a3, the PR's own +/- lines match. That covers every file except the budget, expected_tests and TESTS.md, which only restate counts; check_ledger.tsv and lossy_arms.tsv are identical.
  • Gates: checked at the bottom of this stack (e142a0a6) and at 23f3d52d (#1631). Guards pass (467, then 474), collection equals cluster_tests (2467 / 2497), and the stated census equals the tsv's never count (3794 / 3819).

🤖 Generated with Claude Code

jdatcmd and others added 3 commits October 22, 2026 01:00
… not its fixture

CI failed the harness guards and both cluster-test jobs with:

  REFUSED  test_parquet_nested_import.py imports pyarrow outside require_module (line 63)
  REFUSED  test_parquet_nested_import.py imports pyarrow outside require_module (line 64)

The module fixture imported pyarrow itself to write the reference file.
A fixture cannot decline, so main's guard refuses the import. The fixture
now keeps the database and the directory, and the pyarrow arm runs once,
from the first pyarrow test, with the modules that test's require_module
returned. The check names and the count are unchanged.

Measured:
- Red, the parent's twin: test_harness_deps "the guard half of the corpus
  runs without a database driver" fails with the REFUSED lines above.
- Green: the twin is 7/7 on PG17 and PG19. With pyarrow hidden it is
  5 pass + 2 declined, each pyarrow arm by its own name.
- Mutant, the reference file one row short: both pyarrow arms fail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd no longer passes as survived (#1341)

test/pytest/test_parquet_count_bounds.py ports all 17 checks of
test/parquet_count_bounds.sh by name, using the shell's crafter and
declining by the shell's skip name without pyarrow. Three shell fixes,
in both twins:

- The survival checks read SELECT 1, which answers again after crash
  recovery. With the num_values bound removed (#570), the 2^62 file
  crashed the backend and "and the backend survived it" and "survived the
  list over-read" passed on main. They now also need the server log's
  count of killed backends unmoved since setup, as avro_manifest does
  since #1576; the same crash now reads "no ([1], 1 backend crashes)".
- The two phantom-row checks caught only the exact count the crafter
  declares (40, 8). They now catch any count above the file's true one.
  No mutation here produced a different count, so this hardening is not
  shown red first: under both #571 guards removed, the leak was the
  declared 40, which main caught too.
- The crafter premise covers all seven files; the three list files were
  never checked.

Measured, PG16, shell and twin:
- no570 (the num_values range check removed): the backend crashes. Both
  harnesses red the rejection, the survival check and the detail; what
  else reds depends on how long recovery takes, so the counts differ (7
  in the shell, 11 in the twin), all from reads during recovery.
- no571 alone is masked: pq_require_entry rejects the same files at
  decode time with the same message, so the suite stays 17/17.
- noentry (pq_require_entry refuses nothing): 2 red, the two list
  checks, the same in both twins. no571 with noentry: 9 red, the same 9.
- clean: 17 of 17 on PG15 to PG19 in both twins.

Ledger: 17 rows, 2 dated by noentry and 15 never. The num_values and
num_rows mutations crash the backend and redden collateral checks, so the
ledger cannot attribute them. suites_not_covered 125 -> 124,
cluster_tests 2169 -> 2186, TESTS.md section 233. The ledger gate,
guards (467), name grading and the self-test pass over 9bd1850.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t by importing pyarrow in it

CI failed the harness guards and both cluster-test jobs with:

  REFUSED  test_parquet_count_bounds.py imports pyarrow outside require_module (line 83)

The module fixture imported pyarrow to decide whether to build at all.
A fixture cannot decline, so main's guard refuses the import. Each test
now declines by the shell's skip name first, and only then asks for the
fixture with request.getfixturevalue. The fixture no longer imports
anything, and it never runs on a box without pyarrow. The check names
and the count are unchanged.

Measured:
- Red, the parent: test_harness_deps "the guard half of the corpus runs
  without a database driver" fails with the REFUSED line above.
- Green: test_harness_deps and test_capability_decline, 30 passed, no
  REFUSED line. The twin is 17/17 on PG17 and PG19; with pyarrow hidden it
  is 17 declined.
- Probe: wanting 9 honest rows fails with "got = 8, want = 9", so the
  fixture still crafts and imports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jdatcmd
jdatcmd force-pushed the test/1341-parquet-count-bounds-twin branch from 23f3d52 to d7f291c Compare October 22, 2026 01:06
@jdatcmd

jdatcmd commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

Re-approval needed: rebased onto #1630's e70a166, plus one new commit, d7f291c. CI refused test_parquet_count_bounds.py imports pyarrow outside require_module (line 83). Each test now declines first and then fetches the fixture with request.getfixturevalue, so the fixture imports nothing and never runs without pyarrow. Check names and count unchanged. 17/17 on PG17 and PG19, 17 declined with pyarrow hidden; test_harness_deps + test_capability_decline 30 passed.

@OffgridwithJD OffgridwithJD left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdatcmd Re-approving d7f291c6.

  • Guard: _capability_import_sites prints [] at this head.
  • Decline before fixture: each of the 17 tests calls require_module before request.getfixturevalue("pcb"), checked mechanically.
  • Clean, PG17: 17/17 in shell and twin.
  • Mutant noentry: SAME 2 reds, the same twin names as at my approval.
  • pyarrow absent: 0 pass + 0 fail + 0 unrun + 17 declined = 17, rc 0. The fixture never runs.

🤖 Generated with Claude Code

@jdatcmd
jdatcmd merged commit 4910c16 into main Oct 22, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants