From 6e6ab9f212ef9c1c6984b6250ec867c864ca378b Mon Sep 17 00:00:00 2001 From: David Knaack Date: Sat, 30 Oct 2021 10:52:48 +0200 Subject: [PATCH] fix: ignore scan_dir timeout in tests (#3184) --- src/context.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/context.rs b/src/context.rs index d63d34be..e155799b 100644 --- a/src/context.rs +++ b/src/context.rs @@ -359,7 +359,8 @@ impl DirContents { fs::read_dir(base)? .enumerate() .take_while(|(n, _)| { - n & 0xFF != 0 // only check timeout once every 2^8 entries + cfg!(test) // ignore timeout during tests + || n & 0xFF != 0 // only check timeout once every 2^8 entries || start.elapsed() < timeout }) .filter_map(|(_, entry)| entry.ok())