Skip to content

Commit a99298d

Browse files
thymikeeclaude
andcommitted
test(daemon-client): keep fixture startup errors when teardown fails; reflow package-move comments
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent 5f60896 commit a99298d

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

‎packages/daemon-client/src/daemon-client-timeout.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ function isAffirmativelyApplePlatform(platform: PlatformSelector | undefined): b
154154
// Exported for direct hint-matrix testing: handleRequestTimeout also runs the real liveness probe
155155
// and process-kill side effects, so its wording is verified through this pure sub-function
156156
// (see also the production-seam route tests in
157-
// packages/daemon-client/src/__tests__/daemon-client-timeout-route.test.ts, which prove the liveness-gated
158-
// recovery this route performs — the side of the contract a pure formatter test cannot reach).
157+
// packages/daemon-client/src/__tests__/daemon-client-timeout-route.test.ts, which prove the
158+
// liveness-gated recovery this route performs — the side of the contract a pure formatter test
159+
// cannot reach).
159160
export function resolveRequestTimeoutHint(params: {
160161
remote: boolean;
161162
resetDaemon: boolean;

‎scripts/layering/package-entry-surface.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ function violation(file: string, message: string, line = 1): LayeringViolation {
4848
return { rule: PACKAGE_EXPORT_SURFACE_RULE, file, line, message };
4949
}
5050

51-
/** Keeps test-kit, daemon and daemon-client on one named public entry; test-kit also runs the isolation walk. */
51+
/**
52+
* Keeps test-kit, daemon and daemon-client on one named public entry; test-kit also runs the
53+
* isolation walk.
54+
*/
5255
export function checkPackageEntrySurfaces(
5356
manifests: ParsedManifests,
5457
sources: ReadonlyMap<string, string>,

‎src/__tests__/test-utils/registered-http-daemon.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ export async function startRegisteredHttpDaemon(): Promise<RegisteredHttpDaemon>
5858
const child = spawnRegisteredDaemonFixture(paths, await registrationFor(stub.port), undefined);
5959
await waitForRegisteredDaemonFixture(paths, child);
6060
} catch (error) {
61-
try {
62-
await finishRegisteredDaemonFixture(stateDir);
63-
} finally {
64-
await closeLoopbackServer(stub.server);
65-
}
61+
// Both teardown steps run, and neither failure replaces the startup error.
62+
await Promise.allSettled([
63+
finishRegisteredDaemonFixture(stateDir),
64+
closeLoopbackServer(stub.server),
65+
]);
6666
throw error;
6767
}
6868
return {
@@ -90,7 +90,7 @@ export async function launchesFreshHttpDaemon(
9090
try {
9191
fields = await registrationFor(stub.port);
9292
} catch (error) {
93-
await closeLoopbackServer(stub.server);
93+
await Promise.allSettled([closeLoopbackServer(stub.server)]);
9494
throw error;
9595
}
9696
spawn.mockImplementation((_command, _args, options) =>

0 commit comments

Comments
 (0)