From 3e212f22fc241d32e694f4520ac15a8c1ea7e1d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Chabowski?= <88321181+rafal-ch@users.noreply.github.com> Date: Mon, 14 Oct 2024 19:32:02 +0200 Subject: [PATCH] Disable flaky `test_poa_multiple_producers` test (#2353) This PR disables the flaky `test_poa_multiple_producers` test. Follow-up issue: https://github.com/FuelLabs/fuel-core/issues/2351 ### Before requesting review - [X] I have reviewed the code myself - [X] I have created follow-up issues caused by this PR and linked them here --------- Co-authored-by: green --- crates/services/src/async_processor.rs | 7 ++++++- crates/services/src/sync_processor.rs | 4 ++++ tests/tests/poa.rs | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/crates/services/src/async_processor.rs b/crates/services/src/async_processor.rs index 74f7d8c7954..db929176483 100644 --- a/crates/services/src/async_processor.rs +++ b/crates/services/src/async_processor.rs @@ -270,6 +270,8 @@ mod tests { // Then while broadcast_receiver.recv().await.is_ok() {} assert!(instant.elapsed() >= Duration::from_secs(10)); + // Wait for the metrics to be updated. + tokio::time::sleep(Duration::from_secs(1)).await; let duration = Duration::from_nanos(heavy_task_processor.metric.busy.get()); assert_eq!(duration.as_secs(), 10); let duration = Duration::from_nanos(heavy_task_processor.metric.idle.get()); @@ -302,6 +304,8 @@ mod tests { // Then while broadcast_receiver.recv().await.is_ok() {} assert!(instant.elapsed() <= Duration::from_secs(2)); + // Wait for the metrics to be updated. + tokio::time::sleep(Duration::from_secs(1)).await; let duration = Duration::from_nanos(heavy_task_processor.metric.busy.get()); assert_eq!(duration.as_secs(), 10); let duration = Duration::from_nanos(heavy_task_processor.metric.idle.get()); @@ -333,8 +337,9 @@ mod tests { // Then while broadcast_receiver.recv().await.is_ok() {} - tokio::task::yield_now().await; assert!(instant.elapsed() <= Duration::from_secs(2)); + // Wait for the metrics to be updated. + tokio::time::sleep(Duration::from_secs(1)).await; let duration = Duration::from_nanos(heavy_task_processor.metric.busy.get()); assert_eq!(duration.as_secs(), 0); let duration = Duration::from_nanos(heavy_task_processor.metric.idle.get()); diff --git a/crates/services/src/sync_processor.rs b/crates/services/src/sync_processor.rs index 36fb53bc2a6..4e23a68205f 100644 --- a/crates/services/src/sync_processor.rs +++ b/crates/services/src/sync_processor.rs @@ -209,6 +209,8 @@ mod tests { // Then while broadcast_receiver.recv().await.is_ok() {} assert!(instant.elapsed() >= Duration::from_secs(10)); + // Wait for the metrics to be updated. + tokio::time::sleep(Duration::from_secs(1)).await; let duration = Duration::from_nanos(heavy_task_processor.metric.busy.get()); assert_eq!(duration.as_secs(), 10); } @@ -275,6 +277,8 @@ mod tests { // Then while broadcast_receiver.recv().await.is_ok() {} assert!(instant.elapsed() <= Duration::from_secs(2)); + // Wait for the metrics to be updated. + tokio::time::sleep(Duration::from_secs(1)).await; let duration = Duration::from_nanos(heavy_task_processor.metric.busy.get()); assert_eq!(duration.as_secs(), 10); } diff --git a/tests/tests/poa.rs b/tests/tests/poa.rs index fca05616275..792064fbade 100644 --- a/tests/tests/poa.rs +++ b/tests/tests/poa.rs @@ -259,6 +259,7 @@ mod p2p { // Then starts second_producer that uses the first one as a reserved peer. // second_producer should not produce blocks while the first one is producing // after the first_producer stops, second_producer should start producing blocks + #[ignore = "seems to be flaky, issue: https://github.com/FuelLabs/fuel-core/issues/2351"] #[tokio::test(flavor = "multi_thread")] async fn test_poa_multiple_producers() { const SYNC_TIMEOUT: u64 = 30;