Skip to content

Commit

Permalink
Move test-related mention out of the tested code itself
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Jun 10, 2024
1 parent 0067ad6 commit d83571b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions unified-scheduler-pool/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1063,9 +1063,7 @@ impl<S: SpawnableScheduler<TH>, TH: TaskHandler> ThreadManager<S, TH> {
if sender.send(Err(HandlerPanicked)).is_ok() {
info!("notified a panic from {:?}", current_thread);
} else {
// It seems that scheduler has been aborted...
// This branch is deliberately tested by using 2 transactions with
// different timings in test_scheduler_schedule_execution_panic
// It seems that the scheduler thread has been aborted already...
warn!("failed to notify a panic from {:?}", current_thread);
}
}
Expand Down Expand Up @@ -1834,7 +1832,12 @@ mod tests {

let bank = Bank::new_for_tests(&genesis_config);
let bank = setup_dummy_fork_graph(bank);

// Use 2 transactions with different timings to deliberately cover the two code paths of
// notifying panics in the handler threads, taken conditionally depending on whether the
// scheduler thread has been aborted already or not.
const TX_COUNT: usize = 2;

let ignored_prioritization_fee_cache = Arc::new(PrioritizationFeeCache::new(0u64));
let pool = SchedulerPool::<PooledScheduler<PanickingHandler>, _>::new_dyn(
Some(TX_COUNT), // fix to use exactly 2 handlers
Expand Down

0 comments on commit d83571b

Please sign in to comment.