Skip to content

Commit

Permalink
Panic on unexpected error in simtests
Browse files Browse the repository at this point in the history
  • Loading branch information
petuhovskiy committed Jun 26, 2024
1 parent fdadd6a commit f315fff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion safekeeper/tests/random_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::walproposer_sim::{
pub mod walproposer_sim;

// Generates 2000 random seeds and runs a schedule for each of them.
// If you seed this test fail, please report the last seed to the
// If you see this test fail, please report the last seed to the
// @safekeeper team.
#[test]
fn test_random_schedules() -> anyhow::Result<()> {
Expand Down
9 changes: 7 additions & 2 deletions safekeeper/tests/walproposer_sim/safekeeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use safekeeper::{
wal_storage::Storage,
SafeKeeperConf,
};
use tracing::{debug, info_span};
use tracing::{debug, info_span, warn};
use utils::{
id::{NodeId, TenantId, TenantTimelineId, TimelineId},
lsn::Lsn,
Expand Down Expand Up @@ -247,7 +247,12 @@ pub fn run_server(os: NodeOs, disk: Arc<SafekeeperDisk>) -> Result<()> {
NetEvent::Message(msg) => {
let res = conn.process_any(msg, &mut global);
if res.is_err() {
debug!("conn {:?} error: {:#}", connection_id, res.unwrap_err());
let e = res.unwrap_err();
let estr = e.to_string();
if !estr.contains("finished processing START_REPLICATION") {
warn!("conn {:?} error: {:?}", connection_id, e);
panic!("unexpected error at safekeeper: {:#}", e);
}
conns.remove(&connection_id);
break;
}
Expand Down

0 comments on commit f315fff

Please sign in to comment.