From adb538e61ad57ea0dd0bbfb48a9c69ed091588aa Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Thu, 4 Sep 2025 18:37:26 +0300 Subject: [PATCH] stress: Don't die if database is locked during integrity check --- stress/main.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/stress/main.rs b/stress/main.rs index 2a71de13d..068355927 100644 --- a/stress/main.rs +++ b/stress/main.rs @@ -559,13 +559,19 @@ async fn main() -> Result<(), Box> { const INTEGRITY_CHECK_INTERVAL: usize = 100; if query_index % INTEGRITY_CHECK_INTERVAL == 0 { let mut res = conn.query("PRAGMA integrity_check", ()).await.unwrap(); - if let Some(row) = res.next().await? { - let value = row.get_value(0).unwrap(); - if value != "ok".into() { - panic!("integrity check failed: {:?}", value); + match res.next().await { + Ok(Some(row)) => { + let value = row.get_value(0).unwrap(); + if value != "ok".into() { + panic!("integrity check failed: {:?}", value); + } + } + Ok(None) => { + panic!("integrity check failed: no rows"); + } + Err(e) => { + println!("Error performing integrity check: {e}"); } - } else { - panic!("integrity check failed: no rows"); } } }