test(storage-postgres): default test pools to a 30 s acquire timeout #64

Merged
amiryahaya merged 2 commits from test/acquire-timeout into main 2026-10-26 18:52:50 +01:00
Owner

Why

Main's Rust job (run 29718) failed concurrent_sequences_are_contiguous_and_failed_insert_rolls_back_allocation with Err(Unavailable) on 8 of 20 concurrent appends; another run (29752) failed Database::store() with Err(Connection). The test pools use the library default acquire_timeout of 2 s, which queued tasks and a cold pool's SCRAM setup exceed on a loaded runner. Earlier the same class failed twenty_concurrent_appends_… (audit) and #59's pull-request run.

What

Both test Database helpers now default config() to a 30 s acquire_timeout: tests/common/mod.rs and the private one in tests/postgres.rs (the first commit reached only the shared one; the review caught that the failing test uses the private one). Tests that probe timeouts set their own value after config() (postgres.rs pool-exhaustion and readiness tests use 1 s). The now-redundant per-test overrides in audit_postgres.rs and documents_registry_postgres.rs are removed. Test-only; production defaults are unchanged.

Review

Dual pass done. Ponytail found one Must fix (the private helper in postgres.rs, fixed in the second commit) and the redundant overrides (removed). Correctness pass: no test relied on the 2 s default to observe a fast failure; 30 s is within the config bounds.

Coverage

Workspace line coverage 94.51% (bash scripts/coverage.sh rust, gate 80%); fmt and clippy -D warnings clean.

Not verified

That the Err(Connection) in run 29752 came from the acquire timeout; the log does not say. If the flake survives this change, the cause is elsewhere (runner Postgres).

🤖 Generated with Claude Code

## Why Main's Rust job (run 29718) failed `concurrent_sequences_are_contiguous_and_failed_insert_rolls_back_allocation` with `Err(Unavailable)` on 8 of 20 concurrent appends; another run (29752) failed `Database::store()` with `Err(Connection)`. The test pools use the library default `acquire_timeout` of 2 s, which queued tasks and a cold pool's SCRAM setup exceed on a loaded runner. Earlier the same class failed `twenty_concurrent_appends_…` (audit) and #59's pull-request run. ## What Both test `Database` helpers now default `config()` to a 30 s `acquire_timeout`: `tests/common/mod.rs` and the private one in `tests/postgres.rs` (the first commit reached only the shared one; the review caught that the failing test uses the private one). Tests that probe timeouts set their own value after `config()` (`postgres.rs` pool-exhaustion and readiness tests use 1 s). The now-redundant per-test overrides in `audit_postgres.rs` and `documents_registry_postgres.rs` are removed. Test-only; production defaults are unchanged. ## Review Dual pass done. Ponytail found one Must fix (the private helper in `postgres.rs`, fixed in the second commit) and the redundant overrides (removed). Correctness pass: no test relied on the 2 s default to observe a fast failure; 30 s is within the config bounds. ## Coverage Workspace line coverage 94.51% (`bash scripts/coverage.sh rust`, gate 80%); `fmt` and `clippy -D warnings` clean. ## Not verified That the `Err(Connection)` in run 29752 came from the acquire timeout; the log does not say. If the flake survives this change, the cause is elsewhere (runner Postgres). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The 2 s default failed concurrent_sequences_are_contiguous_... with Unavailable on a
loaded runner (main CI 29718), the same class as the audit append test. Tests that
probe timeouts still set their own value after config().

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
test(storage-postgres): cover postgres.rs's own Database and drop redundant timeout overrides
All checks were successful
CI / Web checks (pull_request) Successful in 47s
CI / Rust checks (pull_request) Successful in 17m30s
9f4c03f080
postgres.rs has a private Database whose config() the first commit did not reach, so the
failing 20-append test kept the 2 s default. The per-test overrides in audit_postgres and
documents_registry_postgres now duplicate the shared default.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Sign in to join this conversation.
No description provided.