Skip to content

Commit ef4130d

Browse files
matt2eclaude
andauthored
fix(db): keep lease releases durable and deflake PostgreSQL lane tests (#8676)
## Summary When the user-deletion worker dropped a lease heartbeat, its pooled connection could be left inside an open transaction. The worker's final lease `release` then reported success but never committed, and a rerun saw the request as "leased by another worker" for up to 60 s. The heartbeat is now one autocommit `UPDATE`. The PR also fixes six PostgreSQL-lane test flakes from the 21–28 Oct 2026 CI audit. It moves one relay test off the 100 ms-acquire test helper before that test starts flaking the same way. This is one of seven PRs split out of the `flakey-tests` branch (siblings below). It touches only `buzz-db`, `buzz-deletion` and `buzz-relay`. Every relay file except `connection.rs` and `boot_lifecycle.rs` changes only for the helper rename in the last row. ### Related issue None found. Nothing on `main` (eda26b9) or in an open PR covers these. G, a single hermit `pgschema` 504 that needs a workflow change, is out of scope. ### Flaky tests fixed | Test | Failing runs | Cause | Change | |---|---|---|---| | `buzz-deletion` `user::worker::postgres_tests::dummy_executor_failure_retries_same_community_stage` (:47) and `next_step_advances_one_handler_at_a_time_through_completion` (:131) | 40439041234 (main), 40399635380#3, 40413732817#1 | **Product bug.** `run_stage_with_heartbeat` drops the renewal future when the stage handler wins `select!`. The heartbeat opened a transaction. sqlx 0.9 bumps `transaction_depth` only after `BEGIN` returns, so a `begin()` dropped mid-`BEGIN` queues no `ROLLBACK`, and the connection goes back to the pool inside an open transaction. The worker's autocommit `release` then ran inside it and never committed. | `EntityDeletionStore::heartbeat` is one autocommit `UPDATE`, guarded by `lock_owned`'s ownership/status/expiry predicate. A superseded lease is never renewed. A new regression test, `dropped_heartbeat_leaves_no_open_transaction_for_the_release`, drops the real heartbeat mid-`BEGIN` through a pausing proxy. | | `buzz-db` `session_statement_timeouts_bound_writer_and_reader_sessions` (runtime/tests.rs:3138, `PoolTimedOut`) | 40128463987, 40314950864#1, 40374286094 (main), 40394821009#1, 40413732817#1 | Each config's lazy reader pool dialled cold inside the 150 ms `READER_ACQUIRE_TIMEOUT`. `Db::new` never runs the boot ping. | Warm the reader the way the relay boots it (`read_pool_boot_ping_for_tests` + `await_idle_floor`). | | `buzz-relay` `startup_owns_the_dependency_sampler` (boot_lifecycle.rs) | Torn scrape: 39865872891 (main), 39624074244#2, 40385799750#1, 40413293801#1. Early exit: 39704588623 | metrics-exporter-prometheus 0.18.3 snapshots counters, then gauges. The scrape that first shows the completion gauge can therefore predate the `checks_total` counters. | Assert on a second scrape, taken after the gauge is seen. On an early relay exit, the helper now panics with the exit status, stdout and stderr. The early exit itself was not reproduced. | | `buzz-db` `sample_writer_waits_for_shared_floor_lock_before_sampling_time` (replica_fence.rs:1086) and `replica_floor_probe_waits_for_shared_writer_and_records_after_release` (runtime/tests.rs:3452) | 39601763602 (main), 40391445284#1, 39825846222, 40301667418 | Both scan cluster-wide `pg_stat_activity` but ran outside the serialized `postgres-cluster-global` group. Connection churn from other tests masked activity (`MaskedActivity { masked: 1 }`). | Rename both with a `cluster_global_` prefix. `nextest show-config test-groups --profile postgres-ci` lists both in the group. | | `buzz-db` `stalled_reader_sessions_release_their_slots_for_new_connections` (reader_pool_postgres_tests.rs:354) | 40399635380#2 | The floor warms one connection, so the second warm-up acquire dials cold inside 150 ms. | Retry only that warm-up acquire on `PoolTimedOut`, for up to 5 s (#8472's precedent). The stall under test keeps the production budget. | | `buzz-db` `readiness_check_cancellation_balances_waiter_and_inflight_connection` (runtime/tests.rs:391, `Elapsed`) | 39785370353 | The test aborted `pg_sleep(5)` after a fixed 25 ms. Recovery lands at server start + 5 s, but the bound is abort + 5 s, a ~22 ms margin locally. | Poll `pg_stat_activity` until the query is active, then abort. Use `pg_sleep(1)` within the unchanged 5 s bound. | | `buzz-relay` `upgrade_would_deny_line_is_written_at_auth_while_open` (connection.rs) | None yet (preventive, added by #8634) | It used the 100 ms-acquire `test_state_with_database_url` against the real test database, the same shape as the `PoolTimedOut` flakes above. | Use `test_state_with_database_url_and_pool_options` with sqlx's default timeout. The 100 ms helper is renamed `test_state_with_unreachable_database_url`; all its remaining callers use closed ports. | Local before/after counts are from the original `flakey-tests` commit (1f0451915), on macOS with OrbStack Postgres: - Regression test: 3/3 FAIL before, 3/3 PASS after. - Worker stress: 3 failures in 288 iterations before; 2,100 passing runs after. - Statement timeouts: 44/50 FAIL before, 50/50 PASS after. - Sampler: 2/200 FAIL before, 200/200 PASS after. - `MaskedActivity` under `pgbench -C`: 2/50 iterations FAIL before. After, the lane passed 3× (613/613) but was not re-run under pgbench. - Stalled reader: 10/30 FAIL before, 30/30 PASS after. - Forced late-`Execute` cancellation: 10/10 FAIL before, 10/10 PASS after. ### Verification This branch was pushed without local re-verification, by the user's choice: local test runs were overloading the machine and failing for that reason. **Hosted CI is the check.** It was pushed with `git push --no-verify`, because the pre-push hook runs clippy and unit tests. - Every file on this branch is byte-identical to its final version on `flakey-tests` (67185df6a), where the counts above were measured. - Not re-run for this PR: clippy, nextest and the Postgres lanes. - Checked for this PR: `git diff --check`, `rustfmt --check` on the changed files, and a conflict-free merge with all six siblings onto `main`. ### Readiness This PR has a product fix (the `buzz-db` lease heartbeat). Under AGENTS.md "Before opening a PR", it needs an agent review and a **human check against a local relay** before `buzz-review-completed` is added. Suggested check: 1. With local Postgres and a relay, submit and approve a user deletion with `buzz-admin user-deletions submit` / `approve`. 2. Run `buzz-admin user-deletions run` until it completes, then run it again at once. 3. Working looks like this: both runs complete, neither reports the request as leased by another worker, and `buzz-admin user-deletions inspect <id>` shows no leftover lease. The original race is rare and is not expected to reproduce by hand; this check confirms releases still commit. ### Merge order Independent of the other six. It merges cleanly onto `main`, and with every sibling, in any order. ### Sibling PRs Split from `flakey-tests` (one PR per area): #8677 (relay E2E helper + Windows shell), #8678 (mobile), #8679 (Tauri apt cache + Windows Rust cap), #8680 (desktop product races), #8681 (desktop E2E state gates), #8682 (desktop E2E composer + row actions). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Matt Toohey <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 1893c3a commit ef4130d

16 files changed

Lines changed: 220 additions & 60 deletions

File tree

‎crates/buzz-db/src/runtime/replica_fence.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1050,7 +1050,7 @@ mod postgres_tests {
10501050
/// still held. It must block until release, then sample.
10511051
#[tokio::test]
10521052
#[ignore = "requires Postgres"]
1053-
async fn sample_writer_waits_for_shared_floor_lock_before_sampling_time() {
1053+
async fn cluster_global_sample_writer_waits_for_shared_floor_lock_before_sampling_time() {
10541054
let (admin, pool, name) = scratch_db().await;
10551055

10561056
let mut blocker = pool.begin().await.expect("begin shared-lock blocker");

‎crates/buzz-db/src/runtime/tests.rs‎

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::{relay_members, thread};
33
use buzz_core::CommunityId;
44
use metrics_util::debugging::{DebugValue, DebuggingRecorder, Snapshotter};
55
use sqlx::{Connection, PgPool};
6+
use std::time::Instant;
67
use uuid::Uuid;
78

89
const TEST_DB_URL: &str = "postgres://buzz:buzz_dev@localhost:5432/buzz"; // sadscan:disable np.postgres.1 -- local test-only credentials
@@ -360,11 +361,34 @@ async fn readiness_check_cancellation_balances_waiter_and_inflight_connection()
360361
querying_db
361362
.readiness_check_sql(
362363
tokio::time::Instant::now() + std::time::Duration::from_secs(5),
363-
"SELECT pg_sleep(5)",
364+
"SELECT pg_sleep(1)",
364365
)
365366
.await
366367
});
367-
tokio::time::sleep(std::time::Duration::from_millis(25)).await;
368+
// Abort only once the server is running the query. sqlx's release ping
369+
// waits for it to finish, so the connection returns about 1 s later,
370+
// well inside the 5 s recovery bound below.
371+
let observer = PgPool::connect(&database_url)
372+
.await
373+
.expect("connect activity observer");
374+
tokio::time::timeout(std::time::Duration::from_secs(5), async {
375+
loop {
376+
let running: bool = sqlx::query_scalar(
377+
"SELECT EXISTS(SELECT 1 FROM pg_stat_activity \
378+
WHERE datname = current_database() AND state = 'active' \
379+
AND query = 'SELECT pg_sleep(1)')",
380+
)
381+
.fetch_one(&observer)
382+
.await
383+
.expect("inspect readiness query");
384+
if running {
385+
break;
386+
}
387+
tokio::time::sleep(std::time::Duration::from_millis(5)).await;
388+
}
389+
})
390+
.await
391+
.expect("readiness query reached the server");
368392
querying.abort();
369393
assert!(querying
370394
.await
@@ -3216,6 +3240,22 @@ fn writer_statement_timeout_is_always_bounded() {
32163240
assert_eq!(MAX_STATEMENT_TIMEOUT_MS, 300_000);
32173241
}
32183242

3243+
/// Poll until the reader pool holds exactly `target` connections, all idle.
3244+
/// Returned and floor-maintenance connections land asynchronously, from
3245+
/// tasks sqlx spawns on drop.
3246+
async fn await_idle_floor(read_pool: &PgPool, target: u32) {
3247+
let deadline = Instant::now() + Duration::from_secs(10);
3248+
while read_pool.size() != target || read_pool.num_idle() != target as usize {
3249+
assert!(
3250+
Instant::now() < deadline,
3251+
"reader pool never settled at {target} idle; size={} idle={}",
3252+
read_pool.size(),
3253+
read_pool.num_idle()
3254+
);
3255+
tokio::time::sleep(Duration::from_millis(10)).await;
3256+
}
3257+
}
3258+
32193259
/// Through the production constructors, every writer session carries the
32203260
/// clamped statement timeout and every replica session the 20 s read
32213261
/// deadline. Mutation oracles: dropping the clamp leaves `0`/`10min` on the
@@ -3245,7 +3285,11 @@ async fn session_statement_timeouts_bound_writer_and_reader_sessions() {
32453285
.await
32463286
.expect("writer timeout");
32473287
assert_eq!(writer, writer_expected, "writer, configured {configured}");
3288+
// Warm the reader the way the relay boots it: the routed-read acquire
3289+
// budget is 150 ms, and a cold dial on a busy server can exceed it.
32483290
let reader_pool = db.read_pool.clone().expect("reader configured");
3291+
db.read_pool_boot_ping_for_tests().await;
3292+
await_idle_floor(&reader_pool, 1).await;
32493293
let reader: String = sqlx::query_scalar("SHOW statement_timeout")
32503294
.fetch_one(&reader_pool)
32513295
.await
@@ -3519,7 +3563,7 @@ async fn replica_floor_writer_transaction_holds_shared_lock() {
35193563

35203564
#[tokio::test]
35213565
#[ignore = "requires Postgres"]
3522-
async fn replica_floor_probe_waits_for_shared_writer_and_records_after_release() {
3566+
async fn cluster_global_replica_floor_probe_waits_for_shared_writer_and_records_after_release() {
35233567
let admin = PgPool::connect(&admin_url().await)
35243568
.await
35253569
.expect("connect admin");

‎crates/buzz-db/src/runtime/tests/reader_pool_postgres_tests.rs‎

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! reader).
44
55
use super::*;
6-
use std::time::Instant;
76

87
/// A `Db` whose writer and lazy reader both point at one scratch database,
98
/// with the fence open so routed reads attempt the reader.
@@ -32,22 +31,6 @@ async fn same_db_reader(prefix: &str, read_max: u32) -> (PgPool, Db, String, Str
3231
(admin, db, wname, scratch_url)
3332
}
3433

35-
/// Poll until the reader pool holds exactly `target` connections, all idle.
36-
/// Returned and floor-maintenance connections land asynchronously, from
37-
/// tasks sqlx spawns on drop.
38-
async fn await_idle_floor(read_pool: &PgPool, target: u32) {
39-
let deadline = Instant::now() + Duration::from_secs(10);
40-
while read_pool.size() != target || read_pool.num_idle() != target as usize {
41-
assert!(
42-
Instant::now() < deadline,
43-
"reader pool never settled at {target} idle; size={} idle={}",
44-
read_pool.size(),
45-
read_pool.num_idle()
46-
);
47-
tokio::time::sleep(Duration::from_millis(10)).await;
48-
}
49-
}
50-
5134
/// Counters keyed by `(name, decision, reason)` labels, drained: each
5235
/// snapshot resets the recorder's counters to zero.
5336
fn drain_counters(
@@ -453,7 +436,20 @@ async fn stalled_reader_sessions_release_their_slots_for_new_connections() {
453436
await_idle_floor(&read_pool, 1).await;
454437
{
455438
let first = read_pool.acquire().await.expect("first warm connection");
456-
let second = read_pool.acquire().await.expect("second warm connection");
439+
// The floor maintenance stops at one, so the second slot is a cold
440+
// dial inside the 150ms acquire budget, which a loaded runner can
441+
// outlast. Warm-up is not under test; the stall below is.
442+
let second = tokio::time::timeout(Duration::from_secs(5), async {
443+
loop {
444+
match read_pool.acquire().await {
445+
Err(sqlx::Error::PoolTimedOut) => continue,
446+
connection => break connection,
447+
}
448+
}
449+
})
450+
.await
451+
.expect("second reader connects within 5s")
452+
.expect("second warm connection");
457453
drop((first, second));
458454
}
459455
await_idle_floor(&read_pool, 2).await;

‎crates/buzz-db/src/store/entity_deletion/leases.rs‎

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,23 +101,41 @@ impl EntityDeletionStore {
101101
}))
102102
}
103103

104-
/// Renew an unexpired lease. An expired or superseded worker cannot revive it.
104+
/// Renew this lease. A superseded lease is never renewed; an expired lease
105+
/// can be renewed only while nobody has reclaimed it.
106+
///
107+
/// One autocommit statement: the worker drops this future whenever its
108+
/// stage handler finishes first, and sqlx 0.9 queues no `ROLLBACK` for a
109+
/// `begin()` dropped while its `BEGIN` is in flight, so the pooled
110+
/// connection would carry an open transaction into the next write.
105111
pub async fn heartbeat(&self, lease: &EntityLease, duration: Duration) -> Result<()> {
106112
let millis = duration_millis(duration)?;
107-
let mut tx = self.pool.begin().await?;
108-
lock_owned(&mut tx, lease).await?;
109-
sqlx::query(
113+
// `lock_owned`'s predicate. After a row-lock wait, Postgres re-checks it
114+
// only if the holder committed an update of this row, so a reclaim's new
115+
// generation always wins. A holder that only locked the row (e.g.
116+
// `save_stage_success`) or rolled back leaves the pre-wait expiry check
117+
// in force, so a heartbeat that waits past expiry still renews. No one
118+
// can reclaim in that window: `claim` skips locked rows.
119+
let renewed = sqlx::query(
110120
"UPDATE entity_deletion_requests
111-
SET lease_expires_at = clock_timestamp() + $2 * interval '1 millisecond',
121+
SET lease_expires_at = clock_timestamp() + $4 * interval '1 millisecond',
112122
heartbeat_at = clock_timestamp()
113-
WHERE id = $1",
123+
WHERE id = $1 AND lease_owner = $2 AND lease_generation = $3
124+
AND status IN ('approved', 'running', 'retry_wait', 'completed')
125+
AND lease_expires_at > clock_timestamp()",
114126
)
115127
.bind(lease.request_id)
128+
.bind(&lease.owner)
129+
.bind(lease.generation)
116130
.bind(millis)
117-
.execute(&mut *tx)
118-
.await?;
119-
tx.commit().await?;
120-
Ok(())
131+
.execute(&self.pool)
132+
.await?
133+
.rows_affected();
134+
if renewed == 1 {
135+
Ok(())
136+
} else {
137+
Err(stale_lease(lease))
138+
}
121139
}
122140

123141
/// Release this live claim after a pause or shutdown, without advancing its stage.

‎crates/buzz-db/src/store/entity_deletion_postgres_tests.rs‎

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use super::*;
2+
use std::time::Duration;
23

34
async fn store() -> EntityDeletionStore {
45
EntityDeletionStore {
@@ -446,6 +447,85 @@ async fn approval_refuses_to_repair_missing_evidence() {
446447
);
447448
}
448449

450+
#[tokio::test]
451+
#[ignore = "requires Postgres"]
452+
async fn dropped_heartbeat_leaves_no_open_transaction_for_the_release() {
453+
let store = store().await;
454+
let request = users(&store)
455+
.submit("demo:dropped-heartbeat", "operator-a", None)
456+
.await
457+
.unwrap();
458+
store
459+
.approve(
460+
request.id,
461+
"operator-b",
462+
request.inventory_digest.as_deref().unwrap(),
463+
)
464+
.await
465+
.unwrap();
466+
let lease = store
467+
.claim(request.id, "worker", Duration::from_secs(60))
468+
.await
469+
.unwrap()
470+
.expect("claim approved request");
471+
472+
let direct = store.pool.connect_options();
473+
let proxy =
474+
crate::test_support::PausingProxy::spawn(direct.get_host().to_owned(), direct.get_port())
475+
.await;
476+
// One connection, so the release reuses the heartbeat's. No acquire ping,
477+
// so the heartbeat's first statement is the one in flight when it drops.
478+
let proxied = EntityDeletionStore {
479+
pool: sqlx::postgres::PgPoolOptions::new()
480+
.max_connections(1)
481+
.test_before_acquire(false)
482+
.connect_with((*direct).clone().host("127.0.0.1").port(proxy.port))
483+
.await
484+
.expect("connect through proxy"),
485+
};
486+
sqlx::query("SELECT 1")
487+
.execute(&proxied.pool)
488+
.await
489+
.expect("warm proxied connection");
490+
// sqlx returns the connection from a spawned task after a ping; pausing
491+
// before it lands would stall the heartbeat in `acquire` instead.
492+
tokio::time::timeout(Duration::from_secs(5), async {
493+
while proxied.pool.num_idle() != 1 {
494+
tokio::time::sleep(Duration::from_millis(10)).await;
495+
}
496+
})
497+
.await
498+
.expect("warm connection returned to the pool");
499+
500+
// The worker's stage `select!` drops the heartbeat whenever the handler
501+
// wins. Holding the bytes drops it with its first round trip in flight.
502+
proxy.set_paused(true);
503+
assert!(tokio::time::timeout(
504+
Duration::from_millis(100),
505+
proxied.heartbeat(&lease, Duration::from_secs(60)),
506+
)
507+
.await
508+
.is_err());
509+
proxy.set_paused(false);
510+
assert!(proxied.release(&lease).await.unwrap());
511+
512+
let lease_owner: Option<String> =
513+
sqlx::query_scalar("SELECT lease_owner FROM entity_deletion_requests WHERE id = $1")
514+
.bind(request.id)
515+
.fetch_one(&store.pool)
516+
.await
517+
.unwrap();
518+
assert_eq!(lease_owner, None, "the reported release must be committed");
519+
let open: i64 = sqlx::query_scalar(
520+
"SELECT count(*) FROM pg_stat_activity
521+
WHERE datname = current_database() AND state = 'idle in transaction'",
522+
)
523+
.fetch_one(&store.pool)
524+
.await
525+
.unwrap();
526+
assert_eq!(open, 0, "no pooled session may sit inside a transaction");
527+
}
528+
449529
fn users(store: &EntityDeletionStore) -> crate::user_deletion::UserDeletionStore {
450530
Db::from_pool(store.pool.clone()).user_deletion_store()
451531
}

‎crates/buzz-deletion/src/user/worker.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ async fn run_stage_with_heartbeat(
121121
// Poll renewal alongside the handler. Awaiting renewal inside a selected
122122
// timer branch would stop polling a handler that may hold the parent lock.
123123
// Both futures live here, so cancellation leaves no detached heartbeat task.
124+
// A handler can finish mid-heartbeat; `heartbeat` is one autocommit
125+
// statement so that drop cannot strand an open transaction on the pool.
124126
let renewal = async {
125127
loop {
126128
interval.tick().await;

‎crates/buzz-relay/src/connection.rs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3798,8 +3798,11 @@ pub(crate) mod terminal_close_delivery_tests {
37983798
#[ignore = "requires Postgres"]
37993799
async fn upgrade_would_deny_line_is_written_at_auth_while_open() {
38003800
let log = crate::nip_fi_shadow::tests::WouldDenyLog::capture();
3801-
let state = crate::state::tests::test_state_with_database_url(
3801+
// sqlx's default acquire timeout: a first connect to a busy CI
3802+
// database can outlast the unreachable-target helper's 100 ms.
3803+
let state = crate::state::tests::test_state_with_database_url_and_pool_options(
38023804
&crate::test_support::database_url(),
3805+
sqlx::postgres::PgPoolOptions::new(),
38033806
)
38043807
.await;
38053808
let community = Uuid::new_v4();
@@ -4158,7 +4161,7 @@ pub(crate) mod terminal_close_delivery_tests {
41584161
.unwrap();
41594162
let ((), lines) = crate::nip_fi_shadow::tests::would_deny_lines(|| {
41604163
rt.block_on(async {
4161-
let state = crate::state::tests::test_state_with_database_url(
4164+
let state = crate::state::tests::test_state_with_unreachable_database_url(
41624165
"postgres://127.0.0.1:1/none",
41634166
)
41644167
.await;

‎crates/buzz-relay/src/handlers/auth.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3939,7 +3939,7 @@ mod tests {
39393939
let recorder = metrics_util::debugging::DebuggingRecorder::new();
39403940
let snapshotter = recorder.snapshotter();
39413941
let _recorder_guard = metrics::set_default_local_recorder(&recorder);
3942-
let state = crate::state::tests::test_state_with_database_url(
3942+
let state = crate::state::tests::test_state_with_unreachable_database_url(
39433943
"postgres://buzz:[email protected]:1/buzz",
39443944
)
39453945
.await;

‎crates/buzz-relay/src/handlers/group_state_postgres_tests.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use crate::state::AppState;
1313
use buzz_auth::Scope;
1414

1515
/// Test state on the shared test database. The pool keeps sqlx's default
16-
/// acquire timeout: `test_state_with_database_url` waits only 100 ms so
17-
/// closed-port tests fail fast, and a first connect to a busy CI database can
18-
/// take longer than that (`PoolTimedOut`).
16+
/// acquire timeout: `test_state_with_unreachable_database_url` waits only
17+
/// 100 ms so closed-port tests fail fast, and a first connect to a busy CI
18+
/// database can take longer than that (`PoolTimedOut`).
1919
pub(crate) async fn state() -> Arc<AppState> {
2020
crate::state::tests::test_state_with_database_url_and_pool_options(
2121
&crate::test_support::database_url(),

‎crates/buzz-relay/src/handlers/ingest.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3818,7 +3818,7 @@ mod postgres_tests {
38183818
#[tokio::test]
38193819
#[ignore = "requires Postgres"]
38203820
async fn check_channel_write_denies_when_channel_lookup_fails() {
3821-
let state = crate::state::tests::test_state_with_database_url(
3821+
let state = crate::state::tests::test_state_with_unreachable_database_url(
38223822
"postgres://buzz:[email protected]:1/buzz", // sadscan:disable np.postgres.1
38233823
)
38243824
.await;

0 commit comments

Comments
 (0)