From 696bfedd97ffdb65f1f9ebdcaab88ba240a6f798 Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:48:56 +0000 Subject: [PATCH 1/3] Simply resume unwind on panic --- src/framework.rs | 4 +--- src/test_case.rs | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/framework.rs b/src/framework.rs index d3596be..1404163 100644 --- a/src/framework.rs +++ b/src/framework.rs @@ -99,7 +99,7 @@ impl TestFramework { } pub async fn init_nodes(&mut self) -> Result<()> { - // Use first node config for now, as we expect citrea nodes to interact only with this main node for now. + // Use first node config for now, as citrea nodes are expected to interact only with this main node for now. // Additional bitcoin node are solely used for simulating a bitcoin network and tx propagation/re-orgs let bitcoin_config = &self.ctx.config.bitcoin[0]; @@ -525,7 +525,5 @@ fn setup_logging() { .with(env_filter) .try_init(); } - - log_panics::init(); }); } diff --git a/src/test_case.rs b/src/test_case.rs index ebaf6f6..f424760 100644 --- a/src/test_case.rs +++ b/src/test_case.rs @@ -113,10 +113,7 @@ impl TestCaseRunner { Ok(Ok(())) => Ok(()), Ok(Err(e)) => Err(e), Err(panic_error) => { - let panic_msg = panic_error - .downcast_ref::() - .map_or_else(|| "Unknown panic".to_string(), ToString::to_string); - bail!(panic_msg) + panic::resume_unwind(panic_error) } } } From 022bd1ad79a901219dc1c9f31bbb3c6b446a535e Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:50:44 +0000 Subject: [PATCH 2/3] Remove udep --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c80e3e1..1a9ef4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,6 @@ bollard = { version = "0.17.1" } futures = "0.3" hex = { version = "0.4.3", default-features = false, features = ["serde"] } jsonrpsee = { version = "0.24.2", features = ["http-client", "ws-client"] } -log-panics = { version = "2", features = ["with-backtrace"] } rand = "0.8" serde = { version = "1.0.192", default-features = false, features = ["alloc", "derive"] } serde_json = { version = "1.0", default-features = false } From 8c958ce5eece24b7a5c594a173a91d79ea5ad2f6 Mon Sep 17 00:00:00 2001 From: jfldde <168934971+jfldde@users.noreply.github.com> Date: Tue, 29 Oct 2024 22:51:56 +0000 Subject: [PATCH 3/3] Fmt --- src/test_case.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test_case.rs b/src/test_case.rs index f424760..82d017c 100644 --- a/src/test_case.rs +++ b/src/test_case.rs @@ -112,9 +112,7 @@ impl TestCaseRunner { match result { Ok(Ok(())) => Ok(()), Ok(Err(e)) => Err(e), - Err(panic_error) => { - panic::resume_unwind(panic_error) - } + Err(panic_error) => panic::resume_unwind(panic_error), } }