From 5107ebabd157521e6d86cc2624b0464bed670b32 Mon Sep 17 00:00:00 2001 From: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz> Date: Fri, 16 Oct 2026 10:16:13 -0400 Subject: [PATCH] test(push-gateway): attempt every probe drop before reporting a drop failure A failed drop of the first probe on a passing run panicked inside the loop and skipped dropping the second probe. Collect drop failures and report them after both drops have been attempted. Signed-off-by: Elrond <28d6302a099e5225b02c4155ac4236e4912603df2ab08dbfc2f4fef08ce598c8@buzz.block.builderlab.xyz> --- .../postgres/desired_schema_postgres_tests.rs | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/crates/buzz-push-gateway/src/postgres/desired_schema_postgres_tests.rs b/crates/buzz-push-gateway/src/postgres/desired_schema_postgres_tests.rs index 4c9b9830f0..74b36d194c 100644 --- a/crates/buzz-push-gateway/src/postgres/desired_schema_postgres_tests.rs +++ b/crates/buzz-push-gateway/src/postgres/desired_schema_postgres_tests.rs @@ -234,20 +234,27 @@ async fn desired_state_schema_matches_migrations() { probes.clone(), )) .await; + // Attempt every drop before reporting any failure, so one failed drop + // never leaks the other probe. + let mut drop_failures = Vec::new(); for db in &probes { - let dropped = sqlx::query(AssertSqlSafe(format!( + if let Err(error) = sqlx::query(AssertSqlSafe(format!( "DROP DATABASE IF EXISTS {db} WITH (FORCE)" ))) .execute(&admin) - .await; - match (dropped, &outcome) { - (Ok(_), _) => {} - (Err(error), Ok(())) => panic!("drop probe database {db}: {error}"), - (Err(error), Err(_)) => eprintln!("could not drop probe database {db}: {error}"), + .await + { + drop_failures.push(format!("drop probe database {db}: {error}")); } } - if let Err(failure) = outcome { - std::panic::resume_unwind(failure.into_panic()); + match outcome { + Err(failure) => { + for message in &drop_failures { + eprintln!("{message}"); + } + std::panic::resume_unwind(failure.into_panic()); + } + Ok(()) => assert!(drop_failures.is_empty(), "{}", drop_failures.join("; ")), } struct PgschemaConnection {