Unverified Commit 96618b87 authored by Niklas Mischkulnig's avatar Niklas Mischkulnig Committed by GitHub

test: unflake lru-disk-eviction on Windows (#90465)

```
FAIL Turbopack test/unit/image-optimizer/lru-disk-eviction.test.ts
  LRU disk eviction
    √ should evict oldest entries on initialization (133 ms)
    √ should evict old entries when new entries are set (124 ms)
    × should promote entries on get() to prevent eviction (8 ms)
    √ should return the same LRU instance on subsequent calls (1 ms)
    √ should deduplicate concurrent init calls (2 ms)
    √ should handle empty cache directory (2 ms)
    √ should handle non-existent cache directory (2 ms)

  ● LRU disk eviction › should promote entries on get() to prevent eviction

    EPERM: operation not permitted, rmdir 'C:\Users\ADMINI~1\AppData\Local\Temp\next-lru-test-dOXRaF\y'
```
parent cbb858f0
...@@ -44,7 +44,12 @@ async function initEntries( ...@@ -44,7 +44,12 @@ async function initEntries(
} }
async function rmEntry(cacheDir: string, cacheKey: string): Promise<void> { async function rmEntry(cacheDir: string, cacheKey: string): Promise<void> {
await promises.rm(join(cacheDir, cacheKey), { recursive: true, force: true }) await promises.rm(join(cacheDir, cacheKey), {
recursive: true,
force: true,
maxRetries: 3,
retryDelay: 500,
})
} }
describe('LRU disk eviction', () => { describe('LRU disk eviction', () => {
...@@ -57,7 +62,12 @@ describe('LRU disk eviction', () => { ...@@ -57,7 +62,12 @@ describe('LRU disk eviction', () => {
afterEach(async () => { afterEach(async () => {
resetDiskLRU() resetDiskLRU()
await promises.rm(cacheDir, { recursive: true, force: true }) await promises.rm(cacheDir, {
recursive: true,
force: true,
maxRetries: 3,
retryDelay: 500,
})
}) })
it('should evict oldest entries on initialization', async () => { it('should evict oldest entries on initialization', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment