Files
open-design/apps/daemon/tests/telemetry-fatal-handler-lifecycle.test.ts
AmyandGitHub a338a13aab test(ci): harden Functional E2E and daemon release gates (#6708)
* test(e2e): harden coverage and runtime isolation

* test(e2e): gate prerelease on full functional suite

* test(daemon): enforce prerelease coverage

* test(daemon): stabilize full-suite fixtures

Generated-By: looper 0.11.8 (runner=fixer, agent=codex)

* test(e2e): preserve interaction regression coverage

Keep deck navigation subject to Playwright actionability checks and restore the current rail updater/composer stacking witness as an explicit expected failure.

Generated-By: looper 0.11.8 (runner=fixer, agent=codex)

* fix(ci): close conformance validation gaps

Generated-By: looper 0.11.8 (runner=fixer, agent=codex)

* test(e2e): restore MCP snippet style guard

Restore the browser-computed style witness that was over-deleted when the OAuth flow moved to Integrations, and navigate through the current Settings MCP server entry.\n\nGenerated-By: looper 0.11.8 (runner=fixer, agent=codex)

* fix(ci): close directive and job-boundary gaps

Compare normalized MUST_FIX directives as sets so identical multi-item rounds remain weak debates, and bound workflow topology assertions to their immediate sibling jobs.\n\nGenerated-By: looper 0.11.8 (runner=fixer, agent=codex)
2026-08-11 08:31:14 +00:00

27 lines
1.1 KiB
TypeScript

import type http from 'node:http';
import { describe, expect, it } from 'vitest';
import { startServer } from '../src/server.js';
describe('daemon fatal telemetry handler lifecycle', () => {
it('removes process-wide fatal handlers when the server closes', async () => {
const uncaughtBaseline = process.listenerCount('uncaughtException');
const rejectionBaseline = process.listenerCount('unhandledRejection');
const started = await startServer({ port: 0, returnServer: true }) as {
server: http.Server;
shutdown?: () => Promise<void> | void;
};
expect(process.listenerCount('uncaughtException')).toBe(uncaughtBaseline + 1);
expect(process.listenerCount('unhandledRejection')).toBe(rejectionBaseline + 1);
await Promise.resolve(started.shutdown?.());
await new Promise<void>((resolve, reject) => {
started.server.close((error) => error ? reject(error) : resolve());
});
expect(process.listenerCount('uncaughtException')).toBe(uncaughtBaseline);
expect(process.listenerCount('unhandledRejection')).toBe(rejectionBaseline);
});
});