perf(test): speed up suites and reduce fs churn

This commit is contained in:
Peter Steinberger
2026-02-15 19:18:49 +00:00
parent 8fdde0429e
commit 92f8c0fac3
32 changed files with 1793 additions and 1398 deletions

View File

@@ -1,20 +1,10 @@
import http from "node:http";
process.stdout.write("ready\n");
const server = http.createServer((_, res) => {
res.writeHead(200, { "content-type": "text/plain" });
res.end("ok");
});
server.listen(0, "127.0.0.1", () => {
const addr = server.address();
if (!addr || typeof addr === "string") {
throw new Error("unexpected address");
}
process.stdout.write(`${addr.port}\n`);
});
const keepAlive = setInterval(() => {}, 1000);
const shutdown = () => {
server.close(() => process.exit(0));
clearInterval(keepAlive);
process.exit(0);
};
process.on("SIGTERM", shutdown);