mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-11-23 21:54:45 +02:00
tests: increase sleep duration for sort file metadata tests on Windows AArch64
Use `cfg!` to assign a 1000ms delay only on Windows Aarch64 targets. This was done because it has been observed to be necessary on this platform. The conditional logic is used because 1s is quite long to wait on every other more sensible platform. Closes #3071, Closes #3072
This commit is contained in:
committed by
Andrew Gallant
parent
56d03a1e2f
commit
60aa9f1727
@@ -1092,16 +1092,22 @@ rgtest!(type_list, |_: Dir, mut cmd: TestCommand| {
|
||||
// This order is important when sorting them by system time-stamps.
|
||||
fn sort_setup(dir: Dir) {
|
||||
use std::{thread::sleep, time::Duration};
|
||||
|
||||
// As reported in https://github.com/BurntSushi/ripgrep/issues/3071
|
||||
// this test fails if sufficient delay is not given on Windows/Aarch64.
|
||||
let delay = if cfg!(all(windows, target_arch = "aarch64")) {
|
||||
Duration::from_millis(1000)
|
||||
} else {
|
||||
Duration::from_millis(100)
|
||||
};
|
||||
let sub_dir = dir.path().join("dir");
|
||||
dir.create("a", "test");
|
||||
sleep(Duration::from_millis(100));
|
||||
sleep(delay);
|
||||
dir.create_dir(&sub_dir);
|
||||
sleep(Duration::from_millis(100));
|
||||
sleep(delay);
|
||||
dir.create(sub_dir.join("c"), "test");
|
||||
sleep(Duration::from_millis(100));
|
||||
sleep(delay);
|
||||
dir.create("b", "test");
|
||||
sleep(Duration::from_millis(100));
|
||||
sleep(delay);
|
||||
dir.create(sub_dir.join("d"), "test");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user