This raises the risk of a failure when there is no bug, but hopefully only slightly, and it's a simple way to verify that the snapshot `journey` test really is running fully in at least one regularlly tested platform.
Unified · Split
| @@ -1903,6 +1903,7 @@ dependencies = [ · 1902 unmodified lines | ||
| 1903 | 1903 | "fastrand", |
| 1904 | 1904 | "gix-features 0.40.0", |
| 1905 | 1905 | "gix-utils 0.1.14", |
| 1906 | + "is_ci", | |
| 1906 | 1907 | "serde", |
| 1907 | 1908 | "tempfile", |
| 1908 | 1909 | ] |
| @@ -27,5 +27,6 @@ serde = { version = "1.0.114", optional = true, default-features = false, featur · 26 unmodified lines | ||
| 27 | 27 | fastrand = { version = "2.1.0", default-features = false, features = ["std"] } |
| 28 | 28 | |
| 29 | 29 | [dev-dependencies] |
| 30 | −tempfile = "3.5.0" | |
| 31 | 30 | crossbeam-channel = "0.5.0" |
| 31 | +is_ci = "1.1.1" | |
| 32 | +tempfile = "3.5.0" | |
| @@ -64,5 +64,9 @@ fn has_granular_times(root: &Path) -> std::io::Result<bool> { · 63 unmodified lines | ||
| 64 | 64 | |
| 65 | 65 | // This could be wrongly false if a filesystem has very precise timings yet is ridiculously |
| 66 | 66 | // fast. Then the `journey` test wouldn't run, though it could. But that's OK, and unlikely. |
| 67 | + // However, for now, on CI, on macOS only, we assert the expectation of high granularity. | |
| 68 | + if cfg!(target_os = "macos") && is_ci::cached() { | |
| 69 | + assert_eq!(times.len(), n); | |
| 70 | + } | |
| 67 | 71 | Ok(times.len() == n) |
| 68 | 72 | } |