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:
1 parent
d7d3bf5b2b
commit
b328ad98fa
1 file changed
+2
-1
@@ -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 get(alice, '/api/moments?m=Moon%20Garden')).moments.length, 1);
|
||||
} 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 });
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user