Skip to content

test: harden retriable predicate tests#23

Merged
lesnik512 merged 2 commits into
mainfrom
test/retriable-extra-cases
Jun 26, 2026
Merged

test: harden retriable predicate tests#23
lesnik512 merged 2 commits into
mainfrom
test/retriable-extra-cases

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Small follow-up to #22 (squash-merged): folds the two deferred Minor findings from that PR's final whole-branch review into the in-memory predicate suite. Test-only — no production code or capability-contract change, so no architecture/ promotion.

Changes (tests/test_retriable.py)

  • _make_dbapi_error now asserts err.orig is not None. The whole matrix hinges on .orig being set (the predicate reads .orig.__cause__); the assertion makes that load-bearing invariant explicit instead of relying on the True-expected cases to fail if it ever regressed.
  • New test_is_retriable_cycle_containing_retriable_link — complements the existing terminate-on-cycle test: a cyclic chain that contains a retriable DBAPIError link returns True (the walk finds the link before the cycle guard re-visits a node).

Planning

Lightweight-lane bundle: planning/changes/2026-06-26.02-retriable-test-hardening/change.md.

Verification

  • just test (Docker Postgres) → 25 passed, 100% coverage
  • just lint-ci → clean; just check-planningplanning: OK

🤖 Generated with Claude Code

lesnik512 and others added 2 commits June 26, 2026 22:52
Folds the two deferred Minor findings from the final review:
- _make_dbapi_error now asserts err.orig is not None, making the
  load-bearing invariant explicit.
- Adds a complementary cycle case whose loop contains a retriable
  DBAPIError node (returns True) — companion to the terminate-on-cycle
  test that returns False.

just test → 25 passed, 100% coverage.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 merged commit dd52097 into main Jun 26, 2026
2 checks passed
@lesnik512 lesnik512 deleted the test/retriable-extra-cases branch June 26, 2026 19:56
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.

1 participant