diff --git a/crates/iroha_core/src/gossiper.rs b/crates/iroha_core/src/gossiper.rs index f883c56ba86..a821a3d8d61 100644 --- a/crates/iroha_core/src/gossiper.rs +++ b/crates/iroha_core/src/gossiper.rs @@ -92,7 +92,7 @@ impl TransactionGossiper { self.handle_transaction_gossip(transaction_gossip); } () = shutdown_signal.receive() => { - iroha_logger::info!("Shutting down transactions gossiper"); + iroha_logger::debug!("Shutting down transactions gossiper"); break; }, } diff --git a/crates/iroha_core/src/kura.rs b/crates/iroha_core/src/kura.rs index 052df481102..d4c8761e6c2 100644 --- a/crates/iroha_core/src/kura.rs +++ b/crates/iroha_core/src/kura.rs @@ -983,8 +983,8 @@ mod tests { .unwrap(); } - #[tokio::test] - async fn kura_not_miss_replace_block() { + #[test] + fn kura_not_miss_replace_block() { let rt = tokio::runtime::Builder::new_multi_thread() .enable_time() .build() @@ -1063,7 +1063,10 @@ mod tests { // Starting with empty block store assert_eq!(block_count.0, 0); - let _handle = Kura::start(kura.clone(), ShutdownSignal::new()); + let _handle = { + let _rt_guard = rt.enter(); + Kura::start(kura.clone(), ShutdownSignal::new()) + }; let state = State::new( World::with([domain, genesis_domain], [account, genesis_account], []), @@ -1133,8 +1136,8 @@ mod tests { blocks.push(block.clone()); kura.store_block(block); } - // Add wait so that previous block is written to the block store - thread::sleep(Duration::from_secs(1)); + const BLOCK_FLUSH_TIMEOUT: Duration = Duration::from_secs(1); + thread::sleep(BLOCK_FLUSH_TIMEOUT); { let mut state_block = state.block_and_revert(); @@ -1151,6 +1154,7 @@ mod tests { blocks.push(block_soft_fork.clone()); kura.replace_top_block(block_soft_fork); } + thread::sleep(BLOCK_FLUSH_TIMEOUT); { let mut state_block: crate::state::StateBlock = state.block(); @@ -1167,6 +1171,7 @@ mod tests { blocks.push(block_next.clone()); kura.store_block(block_next); } + thread::sleep(BLOCK_FLUSH_TIMEOUT); blocks } diff --git a/crates/iroha_core/src/query/store.rs b/crates/iroha_core/src/query/store.rs index d6dbfd9f582..771b8e5c3e9 100644 --- a/crates/iroha_core/src/query/store.rs +++ b/crates/iroha_core/src/query/store.rs @@ -141,7 +141,7 @@ impl LiveQueryStore { }); } () = self.shutdown_signal.receive() => { - iroha_logger::info!("LiveQueryStore is being shut down."); + iroha_logger::debug!("LiveQueryStore is being shut down."); break; } else => break, diff --git a/crates/iroha_futures/src/supervisor.rs b/crates/iroha_futures/src/supervisor.rs index e3d0f2c6a7f..6ef67950489 100644 --- a/crates/iroha_futures/src/supervisor.rs +++ b/crates/iroha_futures/src/supervisor.rs @@ -693,7 +693,8 @@ mod tests { .recv_timeout(OS_THREAD_SPAWN_TICK) .expect("thread should start by now"); signal2.send(); - timeout(TICK_TIMEOUT, sup_fut) + // It is too slow in CI sometimes + timeout(TICK_TIMEOUT * 10, sup_fut) .await .expect("should shutdown within timeout") .expect("should not panic") @@ -715,6 +716,5 @@ mod tests { else { panic!("no other error expected"); }; - println!("hey"); } }