Skip to content

Commit

Permalink
Test: allow deprecated std::panic::PanicInfo in example tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveLauC authored and drmingdrmer committed Jul 22, 2024
1 parent d857a85 commit fff880a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::backtrace::Backtrace;
use std::collections::BTreeMap;
#[allow(deprecated)] // since nightly 1.82
use std::panic::PanicInfo;
use std::time::Duration;

Expand All @@ -12,6 +13,7 @@ use tokio::task;
use tokio::task::LocalSet;
use tracing_subscriber::EnvFilter;

#[allow(deprecated)] // PanicInfo deprecated since nightly 1.82
pub fn log_panic(panic: &PanicInfo) {
let backtrace = format!("{:?}", Backtrace::force_capture());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::backtrace::Backtrace;
use std::collections::BTreeMap;
use std::collections::HashMap;
#[allow(deprecated)] // since nightly 1.82
use std::panic::PanicInfo;
use std::time::Duration;

Expand All @@ -13,6 +14,7 @@ use tokio::task;
use tokio::task::LocalSet;
use tracing_subscriber::EnvFilter;

#[allow(deprecated)] // PanicInfo deprecated since nightly 1.82
pub fn log_panic(panic: &PanicInfo) {
let backtrace = format!("{:?}", Backtrace::force_capture());

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::backtrace::Backtrace;
use std::collections::BTreeMap;
use std::collections::BTreeSet;
#[allow(deprecated)] // since nightly 1.82
use std::panic::PanicInfo;
use std::time::Duration;

Expand All @@ -21,6 +22,7 @@ use tokio::task;
use tokio::task::LocalSet;
use tracing_subscriber::EnvFilter;

#[allow(deprecated)] // PanicInfo deprecated since nightly 1.82
pub fn log_panic(panic: &PanicInfo) {
let backtrace = format!("{:?}", Backtrace::force_capture());

Expand Down
2 changes: 2 additions & 0 deletions examples/raft-kv-memstore/tests/cluster/test_cluster.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::backtrace::Backtrace;
use std::collections::BTreeMap;
#[allow(deprecated)] // since nightly 1.82
use std::panic::PanicInfo;
use std::thread;
use std::time::Duration;
Expand All @@ -13,6 +14,7 @@ use raft_kv_memstore::store::Request;
use tokio::runtime::Runtime;
use tracing_subscriber::EnvFilter;

#[allow(deprecated)] // PanicInfo deprecated since nightly 1.82
pub fn log_panic(panic: &PanicInfo) {
let backtrace = {
format!("{:?}", Backtrace::force_capture())
Expand Down
2 changes: 2 additions & 0 deletions examples/raft-kv-rocksdb/tests/cluster/test_cluster.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::backtrace::Backtrace;
use std::collections::BTreeMap;
#[allow(deprecated)] // since nightly 1.82
use std::panic::PanicInfo;
use std::thread;
use std::time::Duration;
Expand All @@ -13,6 +14,7 @@ use raft_kv_rocksdb::Node;
use tokio::runtime::Handle;
use tracing_subscriber::EnvFilter;

#[allow(deprecated)] // PanicInfo deprecated since nightly 1.82
pub fn log_panic(panic: &PanicInfo) {
let backtrace = { format!("{:?}", Backtrace::force_capture()) };

Expand Down

0 comments on commit fff880a

Please sign in to comment.