Fix channel panic in tests (#16503) (#16543)

* Fix channel panic

* Add exit signal to PohRecorder because Crossbeam doesnt drop objects inside dropped channel

(cherry picked from commit f0c150cfb9)

Co-authored-by: carllin <carl@solana.com>
This commit is contained in:
mergify[bot]
2021-04-14 19:04:31 +00:00
committed by GitHub
parent 28683b0ad8
commit ff1171338f
5 changed files with 131 additions and 49 deletions

View File

@@ -331,7 +331,7 @@ mod test {
system_program, system_transaction,
timing::timestamp,
};
use std::sync::mpsc::channel;
use std::sync::{atomic::AtomicBool, mpsc::channel};
#[test]
fn service_exit() {
@@ -811,6 +811,7 @@ mod test {
&Arc::new(blockstore),
&Arc::new(LeaderScheduleCache::new_from_bank(&bank)),
&Arc::new(PohConfig::default()),
Arc::new(AtomicBool::default()),
);
let node_keypair = Arc::new(Keypair::new());