Skip to content

test: ttl_expire's twins ask the same question: expire's return on a date column, the no-retention SQLSTATE (#1339) - #1355

Merged
jdatcmd merged 2 commits into
commandprompt:mainfrom
OffgridwithJD:test/1339-ttl-twins
Oct 14, 2026
Merged

jdatcmd merged 2 commits into
commandprompt:mainfrom
OffgridwithJD:test/1339-ttl-twins

Conversation

@OffgridwithJD

Copy link
Copy Markdown
Collaborator

Part of #1339: the last two test_ttl_expire findings assigned to me, and one mislabel. Each fix makes the two twins ask the same question. Each is shown red under a mutation that the pre-fix twin survives, both twins run on PG17 against main (95b4112).

Findings

finding mutation main this branch
pytest :511 [twin_mismatch]: "expire on a date column retires at least one group" discarded expire's return, called it again, and decided from the row count. The shell twin reads the return value. expire returns 0 * retired (it still retires) pytest date test green (shell red) pytest "got 'RETIRED NOTHING (0)' want 'retired'", both twins red
shell :136 [twin_mismatch]: the no-retention arm grepped for ERROR|no retention|ttl, so any failure passed: a missing function, a non-owner, an internal error. The pytest twin requires 55000. the refusal raised as ERRCODE_INTERNAL_ERROR shell 67/67 (pytest red) shell "got [XX000] want [55000]", both twins red
:659 [mislabelled]: premise: compact_rewrite retired a group checks product code, so it is an arm (#1236) compact_rewrite rewrites nothing red in both twins, as a premise the same red, now as an arm

The shell twin now uses the suite's existing ttl_state helper, moved up from the negative-interval section so this arm can use it. The pytest date arm reads the first call's return value and drops the second call.

Evidence

Overlap

With #1353 (same two files): git auto-merges the test files. Only the ledger and budget conflict, so whichever lands second restates. #1350, #1351 and #1354 also move the budget.

🤖 Generated with Claude Code

@jdatcmd jdatcmd 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.

Approving the content at 8edecce. On PG18 I reproduced the shell claim: with the no-retention refusal raised as ERRCODE_INTERNAL_ERROR, main's shell twin passes 67/67, and this head fails with a table with no declared retention is an error, not a silent success: got [XX000] want [55000]. The date arm now reads expire's return, as the shell does, and moving ttl_state up so both twins ask the same question is right.

Order: main is now e848f8f (#1354 merged) at 2327 / 1803, so this needs a rebase like the others. Since it shares test_ttl_expire and ttl_expire.sh with #1353, I'd land it right after #1353: #1350 → #1351 → #1353 → #1355 → my #1356. Rebase it when #1353 is in, and I'll check the ledger and merge.

jdatcmd and others added 2 commits October 14, 2026 01:03
…date column, the no-retention SQLSTATE (commandprompt#1339)

The pytest date arm decided "retires at least one group" from the row count,
discarding expire's own return, which the shell twin reads. The shell's
no-retention arm accepted any ERROR, where the pytest twin requires 55000.
compact_rewrite's retire is product behaviour, so it is an arm, not a premise.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two arms gain their first red date: the no-retention arm (refusal raised as
XX000) and "compact_rewrite retired a group", renamed from a premise with its
history (compact_rewrite returning 0). Census 1798 -> 1796.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

@jdatcmd, rebased onto 25118c0 (#1353 merged). The new head is 3d87595, replacing 8edecce. Ledger: 2343 / 1796, as you expected.

The merge.

Evidence, re-run on the merged tree (main 25118c0 against this head):

  • Clean: ttl_expire 70/70 and test_ttl_expire.py 10 passed on each of PG 15–19.
  • PG17, each mutant against main and this head:
    • expire returns 0 * retired: main's pytest date test stays green; here it is red ("RETIRED NOTHING (0)").
    • The no-retention refusal raised as XX000: main's shell is 70/70; here it is red ("got [XX000] want [55000]").
    • compact_rewrite returns 0: red in both twins, on main as a premise and here as an arm.

Checks.

  • Gate: --against origin/main gives rc=0, the census agrees at 1796, and the ceiling stays 246 → 246.
  • Database-free set: 429 passed.

@OffgridwithJD

Copy link
Copy Markdown
Collaborator Author

@jdatcmd, CI is green on 3d87595 (15/15). CI runs the suites on 17 and 18 only; my re-run on this merged head covers 15–19 (ttl_expire 70/70, test_ttl_expire.py 10 passed). Ready for your approval and merge. After it, #1361 is the oldest of my open ones that touches no file #1356 does, as far as I can tell. Restating is fine in any order.

@jdatcmd jdatcmd 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.

Re-approving 3d87595.

  • Ledger: a recount gives 2343 / 1796, which agrees with the budget. No duplicate keys, no dated premise: row.
  • Patch: the ttl_expire changes are identical to 8edecce, the head I reviewed and reproduced (41 changed lines, no difference).
  • Counts, on this head: database-free set 429 passed; cluster collection matches cluster_tests.

Merging.

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