From 57db67608d023638b12c306f18fbd4e46c680a3c Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Wed, 30 Oct 2024 03:13:34 +0000 Subject: [PATCH 1/4] test: workaround: increase threads number to 8 --- tests/sorock-tests/tests/6_persistency.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/sorock-tests/tests/6_persistency.rs b/tests/sorock-tests/tests/6_persistency.rs index cc7d0f6b..afe3f540 100644 --- a/tests/sorock-tests/tests/6_persistency.rs +++ b/tests/sorock-tests/tests/6_persistency.rs @@ -3,7 +3,10 @@ use rand::Rng; use sorock_tests::*; use std::time::Duration; -#[tokio::test(flavor = "multi_thread")] +// FIXME +// Lowering the number of worker threads like to 2 causes the query to timeout. +// This is likely due to threads being blocked and this should be resolved. +#[tokio::test(flavor = "multi_thread", worker_threads = 8)] async fn n3_restore() -> Result<()> { let mut cluster = Cluster::builder() .with_persistency(true) @@ -36,7 +39,7 @@ async fn n3_restore() -> Result<()> { cluster.env().add_node(1); cluster.env().check_connectivity(1).await?; // Wait for election. - tokio::time::sleep(Duration::from_secs(30)).await; + tokio::time::sleep(Duration::from_secs(5)).await; assert_eq!(cluster.user(1).read(0).await?, cur_state); Ok(()) From d9fe6ecca5d8f9cf9011616fb6a268d569f7954f Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Wed, 30 Oct 2024 03:54:47 +0000 Subject: [PATCH 2/4] upd Signed-off-by: Akira Hayakawa --- tests/env/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/env/src/lib.rs b/tests/env/src/lib.rs index 41b76406..b2df36da 100644 --- a/tests/env/src/lib.rs +++ b/tests/env/src/lib.rs @@ -168,7 +168,7 @@ impl Env { // On terminating the tokio runtime, // flooding stack traces are printed and they are super noisy. // Until better idea is invented, we just suppress them. - std::panic::set_hook(Box::new(|_info| {})); + // std::panic::set_hook(Box::new(|_info| {})); if with_logging { let format = tracing_subscriber::fmt::format() From 76886be28e72ef2d139acd808124a7bddd0121f7 Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Wed, 30 Oct 2024 05:13:48 +0000 Subject: [PATCH 3/4] upd Signed-off-by: Akira Hayakawa --- tests/env/src/lib.rs | 2 +- tests/sorock-tests/tests/6_persistency.rs | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/env/src/lib.rs b/tests/env/src/lib.rs index b2df36da..41b76406 100644 --- a/tests/env/src/lib.rs +++ b/tests/env/src/lib.rs @@ -168,7 +168,7 @@ impl Env { // On terminating the tokio runtime, // flooding stack traces are printed and they are super noisy. // Until better idea is invented, we just suppress them. - // std::panic::set_hook(Box::new(|_info| {})); + std::panic::set_hook(Box::new(|_info| {})); if with_logging { let format = tracing_subscriber::fmt::format() diff --git a/tests/sorock-tests/tests/6_persistency.rs b/tests/sorock-tests/tests/6_persistency.rs index afe3f540..7643815d 100644 --- a/tests/sorock-tests/tests/6_persistency.rs +++ b/tests/sorock-tests/tests/6_persistency.rs @@ -3,10 +3,7 @@ use rand::Rng; use sorock_tests::*; use std::time::Duration; -// FIXME -// Lowering the number of worker threads like to 2 causes the query to timeout. -// This is likely due to threads being blocked and this should be resolved. -#[tokio::test(flavor = "multi_thread", worker_threads = 8)] +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn n3_restore() -> Result<()> { let mut cluster = Cluster::builder() .with_persistency(true) From 157a83d12133941e64b0d3c6913308fe3c9fddc2 Mon Sep 17 00:00:00 2001 From: Akira Hayakawa Date: Wed, 30 Oct 2024 05:32:04 +0000 Subject: [PATCH 4/4] upd Signed-off-by: Akira Hayakawa --- tests/env/src/lib.rs | 1 + tests/sorock-tests/tests/6_persistency.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/env/src/lib.rs b/tests/env/src/lib.rs index 41b76406..62887c1e 100644 --- a/tests/env/src/lib.rs +++ b/tests/env/src/lib.rs @@ -91,6 +91,7 @@ impl Node { .name(nd_tag.clone()) .spawn(move || { let runtime = tokio::runtime::Builder::new_multi_thread() + .worker_threads(8) .thread_name(nd_tag) .enable_all() .build() diff --git a/tests/sorock-tests/tests/6_persistency.rs b/tests/sorock-tests/tests/6_persistency.rs index 7643815d..32187a2d 100644 --- a/tests/sorock-tests/tests/6_persistency.rs +++ b/tests/sorock-tests/tests/6_persistency.rs @@ -3,7 +3,7 @@ use rand::Rng; use sorock_tests::*; use std::time::Duration; -#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +#[tokio::test(flavor = "multi_thread")] async fn n3_restore() -> Result<()> { let mut cluster = Cluster::builder() .with_persistency(true)