perf(test): trim duplicate e2e suites and harden signal hooks

This commit is contained in:
Peter Steinberger
2026-02-13 16:46:31 +00:00
parent 45b9aad0f4
commit 1eccfa8934
8 changed files with 79 additions and 319 deletions

View File

@@ -330,11 +330,17 @@ export async function runGmailService(opts: GmailRunOptions) {
void startGmailWatch(runtimeConfig);
}, renewMs);
const detachSignals = () => {
process.off("SIGINT", shutdown);
process.off("SIGTERM", shutdown);
};
const shutdown = () => {
if (shuttingDown) {
return;
}
shuttingDown = true;
detachSignals();
clearInterval(renewTimer);
child.kill("SIGTERM");
};
@@ -344,6 +350,7 @@ export async function runGmailService(opts: GmailRunOptions) {
child.on("exit", () => {
if (shuttingDown) {
detachSignals();
return;
}
defaultRuntime.log("gog watch serve exited; restarting in 2s");