瀏覽代碼

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.
_Kerman 2 月之前
父節點
當前提交
8baa987387

+ 1 - 1
packages/session/session-projection-cache/tests/cache.spec.ts

@@ -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', () => {

+ 1 - 1
packages/storage/storage-json/tests/json-backend.spec.ts

@@ -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 })