From 9d84f357b6b075baea24e6fb794e4abf95996a11 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 18 Jan 2023 21:29:37 +1000 Subject: [PATCH] Probable fix for flaky test --- rslib/src/sync/http_client/io_monitor.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rslib/src/sync/http_client/io_monitor.rs b/rslib/src/sync/http_client/io_monitor.rs index 6356f4918..701c70263 100644 --- a/rslib/src/sync/http_client/io_monitor.rs +++ b/rslib/src/sync/http_client/io_monitor.rs @@ -194,9 +194,11 @@ mod test { use super::*; use crate::sync::error::HttpError; - /// Longer delays on Windows + /// The delays in the tests are aggressively short, and false positives slip through + /// on a loaded system - especially on Windows. Fix by applying a universal + /// multiplier. fn millis(millis: u64) -> Duration { - Duration::from_millis(millis * if cfg!(windows) { 10 } else { 1 }) + Duration::from_millis(millis * if cfg!(windows) { 10 } else { 5 }) } #[tokio::test]