From 4cce4619dedb62454ab3c27ee05202f8b1a24166 Mon Sep 17 00:00:00 2001 From: Tin Dang Date: Fri, 17 Jul 2026 14:09:37 +0700 Subject: [PATCH] =?UTF-8?q?test(persistence):=20cfg(unix)-gate=20the=20dir?= =?UTF-8?q?-lost=20latch=20unit=20test=20=E2=80=94=20Windows=20Check=20red?= =?UTF-8?q?=20on=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Windows Check (main-push-only, PR-invisible) failed 3/3 tries on test_dir_lost_latches_pauses_and_self_heals after #369 merged: the non-unix query_free_bytes stub always returns Ok, so the dir-lost latch never engages on Windows BY DESIGN — the test's dir_lost() assertion can't hold there. Gate the latch-behavior test with cfg(unix); the disarmed-guard sibling stays cross-platform (its expectations hold under the stub). Same Windows-gate treatment the integration suite already had (#![cfg(unix)]). author: Tin Dang --- CHANGELOG.md | 4 +++- src/shard/disk_monitor.rs | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3135fe7b..9c0d0864 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 (adversarial review): WAL segment rotation re-creates a missing parent directory (`mkdir -p ` after an incident no longer leaves the nested `wal-v3/` dir dead), and any tick-flush failure arms a 1s retry backoff so - no flush error class can ever loop at the 1ms tick cadence again. + no flush error class can ever loop at the 1ms tick cadence again. The + latch is unix-only by design (the non-unix statvfs stub never fails); the + latch-behavior unit test is `cfg(unix)`-gated accordingly. ### Performance - **Disk-offload: shard event loop no longer pays manifest-commit fsyncs diff --git a/src/shard/disk_monitor.rs b/src/shard/disk_monitor.rs index ef1085d3..81d440d3 100644 --- a/src/shard/disk_monitor.rs +++ b/src/shard/disk_monitor.rs @@ -563,6 +563,11 @@ mod tests { d } + // unix-only: the non-unix `query_free_bytes` stub always returns `Ok`, + // so the latch (by design) never engages on Windows — this test would + // fail its `dir_lost()` assertion there. The Windows Check job runs on + // main pushes only, so a missing gate here is invisible on the PR. + #[cfg(unix)] #[test] fn test_dir_lost_latches_pauses_and_self_heals() { let d = scratch_dir("latch");