fix: ignore scan_dir timeout in tests (#3184)

This commit is contained in:
David Knaack 2021-10-30 10:52:48 +02:00 committed by GitHub
parent 265b92bd51
commit 6e6ab9f212
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -359,7 +359,8 @@ impl DirContents {
fs::read_dir(base)? fs::read_dir(base)?
.enumerate() .enumerate()
.take_while(|(n, _)| { .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 || start.elapsed() < timeout
}) })
.filter_map(|(_, entry)| entry.ok()) .filter_map(|(_, entry)| entry.ok())