mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-08-04 22:01:25 +00:00
test: absorb the teardown write race in the context-tree API suite
server.close() only stops new connections; an in-flight fire-and-forget cache save can land a file mid-recursive-rm, surfacing as ENOTEMPTY on slower runners (run #5). fs.rm's built-in retries absorb the window.
This commit is contained in:
parent
7909af1035
commit
f9669cee33
1 changed files with 6 additions and 2 deletions
|
|
@ -56,8 +56,12 @@ describe('web dashboard /api/context/tree: session id prefix', () => {
|
|||
|
||||
afterEach(async () => {
|
||||
await new Promise<void>((resolve) => server.close(() => resolve()))
|
||||
await rm(homeDir, { recursive: true, force: true })
|
||||
await rm(cacheDir, { recursive: true, force: true })
|
||||
// close() only stops new connections; a request handler's fire-and-forget
|
||||
// cache save can still land a file mid-recursive-rm, which surfaces as
|
||||
// ENOTEMPTY on slower runners. fs.rm's built-in retries absorb exactly
|
||||
// that window.
|
||||
await rm(homeDir, { recursive: true, force: true, maxRetries: 10, retryDelay: 50 })
|
||||
await rm(cacheDir, { recursive: true, force: true, maxRetries: 10, retryDelay: 50 })
|
||||
})
|
||||
|
||||
it('resolves a full session id (control case)', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue