Moments test waits for the server to exit before removing its folder

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MaashkinoozheandClaude Opus 5.5 committed 2026-10-29 22:52:29 +01:00
1 parent d7d3bf5b2b
commit b328ad98fa
1 file changed
+2 -1
+2 -1
View File
@@ -143,7 +143,8 @@ test('moments are private, validated, editable and survive page renumbering as "
assert.equal((await post(alice, '/api/moments/delete', { id: spread.id })).status, 200); assert.equal((await post(alice, '/api/moments/delete', { id: spread.id })).status, 200);
assert.equal((await get(alice, '/api/moments?m=Moon%20Garden')).moments.length, 1); assert.equal((await get(alice, '/api/moments?m=Moon%20Garden')).moments.length, 1);
} finally { } finally {
if (child) child.kill(); // The server writes db.json on SIGTERM; removing the folder before it exits races that write.
if (child && child.exitCode === null) await new Promise(resolve => { child.once('exit', resolve); child.kill(); });
fs.rmSync(root, { recursive: true, force: true }); fs.rmSync(root, { recursive: true, force: true });
} }
}); });