test(storage): harden windows-native teardown and chmod probe

The per-record rm in the cache spec hits an EPERM flake on windows
native (directory still draining); retry the recursive rm like the
subagent spec does. The unreadable-record probe is meaningless on
windows, where chmod 0o000 is a no-op; skip it there.
This commit is contained in:
_Kerman 2026-08-21 10:46:21 +08:00
parent 1134c2a98e
commit 8baa987387
2 changed files with 2 additions and 2 deletions

View file

@ -138,7 +138,7 @@ const settle = () => new Promise(resolve => setTimeout(resolve, 40))
afterEach(async () => {
vi.useRealTimers()
await Promise.all(contexts.splice(0).map(ctx => ctx.fiber.dispose()))
await Promise.all(roots.splice(0).map(root => rm(root, { recursive: true, force: true })))
await Promise.all(roots.splice(0).map(root => rm(root, { recursive: true, force: true, maxRetries: 10, retryDelay: 100 })))
})
describe('SessionProjectionCache write policy', () => {

View file

@ -327,7 +327,7 @@ describe('per-record layout', () => {
await backend.close()
})
it('reads an unreadable record document as absent (per-record contract)', async () => {
it.skipIf(process.platform === 'win32')('reads an unreadable record document as absent (per-record contract)', async () => {
const root = await freshRoot()
const path = recordPath(root, 'locked')
await mkdir(join(root, 'recs', 't'), { recursive: true })