test: harden weak audit assertions (F7-04, F7-06, F7-11, F7-10, F7-05, F3-05)#91
Merged
Conversation
…, F3-05) Strengthen tests the pass-3 audit flagged as passing-too-easily: - F7-04: new test_fetch_skips_rows_locked_by_another_transaction locks 20 rows in an open transaction and asserts a concurrent fetch promptly claims the disjoint 10 — a regression to plain FOR UPDATE blocks and fails via wait_for timeout. (The sibling no-double-claim test would pass without SKIP LOCKED.) - F7-06: assert dispatch_one threads row.id + acquired_token (the lease guard) into delete_with_lease, not just the connection. - F7-11: capture and assert the relayed body on the successful at-least-once retry. - F7-10: identity-check the FastAPI-injected producer/client against the swapped fakes (the Context annotation string is load-bearing); add TestOutboxBroker.fake_producer. - F7-05: assert the DLQ headers audit column round-trips (off-Postgres guard). - F3-05: new test_dlq_cte_quotes_adversarial_table_names pins identifier quoting at the one raw-SQL site (names with embedded " and ;). just test -> 509 passed, 100% coverage; just lint clean. Deferred to a follow-up: F7-07 (NOTIFY-wakeup determinism), F7-09 (telemetry exact bounds, 4 files), F1-08 (sync-dispatch via fake fetch — higher risk). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
What
PR 2 of the tail program. Strengthens tests the 2026-06-14 pass-3 audit flagged as passing-too-easily (they'd survive real regressions).
test_fetch_skips_rows_locked_by_another_transaction: locks 20 of 30 rows in an open transaction, then asserts a concurrentclient.fetchpromptly claims the disjoint 10. A regression fromFOR UPDATE SKIP LOCKEDto plainFOR UPDATEwould block on the locked rows → the boundedwait_forfails via timeout. (The existing no-double-claim test guards its named invariant but would pass without SKIP LOCKED.)dispatch_onethreadsrow.id+row.acquired_token(the load-bearing lease guard) intodelete_with_lease, not just the connection.Context(...)annotation string is the load-bearing artifact;isinstancewould pass on a wrong instance). AddsTestOutboxBroker.fake_producer, symmetric withfake_client.headersaudit column round-trips (off-Postgres guard on the fake's DLQ copy).test_dlq_cte_quotes_adversarial_table_namespins identifier quoting at the one raw-SQL site (table names with embedded"and;); a refactor droppingformat_tablewould fail it.Verification
just test→ 509 passed, 100% coveragejust lintclean (ruff + ty)Deferred to a follow-up
_wait_for_notify_or_timeout)fake_client.fetch— touches the sync-dispatch path, higher risk; deserves its own focused change)🤖 Generated with Claude Code