Skip to content

Commit

Permalink
Merge pull request #4589 from eval-exec/exec/fix-ci
Browse files Browse the repository at this point in the history
Integration Test: Add more log when node crash
  • Loading branch information
eval-exec authored Aug 15, 2024
2 parents bfcab0c + 4c255f4 commit 1d27c02
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,9 @@ impl Node {
status,
self.log_path().display()
);
info!("Last 200 lines of log:");
info!("Last 500 lines of log:");
self.print_last_500_lines_log(&self.log_path());
info!("End of last 200 lines of log");
info!("End of last 500 lines of log");
// parent process will exit
return;
}
Expand All @@ -693,6 +693,9 @@ impl Node {
error,
self.log_path().display()
);
info!("Last 500 lines of log:");
self.print_last_500_lines_log(&self.log_path());
info!("End of last 500 lines of log");
return;
}
}
Expand All @@ -708,7 +711,7 @@ impl Node {
self.set_node_id(node_info.node_id.as_str());
}

fn print_last_500_lines_log(&self, log_file: &Path) {
pub(crate) fn print_last_500_lines_log(&self, log_file: &Path) {
let file = File::open(log_file).expect("open log file");
let reader = BufReader::new(file);
let lines: Vec<String> = reader.lines().map(|line| line.unwrap()).collect();
Expand Down
5 changes: 5 additions & 0 deletions test/src/specs/tx_pool/send_large_cycles_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,11 @@ impl Spec for SendLargeCyclesTxToRelay {
.transaction
.is_some()
});
if !result {
info!("node0 last 500 log begin");
node0.print_last_500_lines_log(&node0.log_path());
info!("node0 last 500 log end");
}
assert!(result, "Node0 should accept tx");
}

Expand Down

0 comments on commit 1d27c02

Please sign in to comment.