fix: preserve cancellation when change-time settles

This commit is contained in:
morluto committed 2026-11-11 20:16:24 +08:00
1 parent 5bb34ce522
commit 66e85df5c5
2 files changed
+17 -2

No files matched your search

+14
View File
@@ -271,3 +271,17 @@ it("does not consume Windows limits on other hosts and preserves cancellation du
),
).rejects.toBe(reason);
});
it("preserves cancellation during a Windows read even when the timestamp is stable", async () => {
const controller = new AbortController();
const reason = new Error("cancelled during read");
await expect(
settleChangeTimeBaseline(
async () => {
controller.abort(reason);
return statsAt(1);
},
{ platform: "win32", now: () => 10000, signal: controller.signal },
),
).rejects.toBe(reason);
});