diff --git a/gix-fs/tests/fs/snapshot.rs b/gix-fs/tests/fs/snapshot.rs index 40939dea15e..d7f4ae91c58 100644 --- a/gix-fs/tests/fs/snapshot.rs +++ b/gix-fs/tests/fs/snapshot.rs @@ -50,5 +50,8 @@ fn has_nanosecond_times(root: &Path) -> std::io::Result { std::fs::write(&test_file, "b")?; let second_time = test_file.metadata()?.modified()?; - Ok(first_time != second_time) + Ok(second_time.duration_since(first_time).is_ok_and(|d| + // This can be falsely false if a filesystem would be ridiculously fast, + // which means a test won't run even though it could. But that's OK, and unlikely. + d.subsec_nanos() != 0)) }