Files
paseo/packages/app/e2e/browser/daemon-lifecycle.spec.ts
T
Mohamed Boudra 264276880e fix(daemon): keep lifecycle operations on the selected instance
Restart reconstructed launch inputs and address fallback could redirect a home-selected shutdown to another daemon. Let supervisors publish bound endpoints, retain their worker restart contract, and share captured local lifecycle ownership between CLI and Desktop.
2026-09-09 14:09:53 +02:00

28 lines
1007 B
TypeScript

import { randomUUID } from "node:crypto";
import { expect, test } from "../support/fixtures";
import { startIsolatedHostDaemon } from "../support/helpers/isolated-host-daemon";
import {
openDaemonOverview,
restartDaemonInSettings,
expectDaemonRestartComplete,
readWorkerPid,
} from "../support/helpers/daemon-lifecycle";
test("settings restart waits for a replacement worker while retaining the supervisor", async ({
page,
}, testInfo) => {
const daemon = await startIsolatedHostDaemon(randomUUID());
try {
const supervisor = daemon.getPid();
const previousWorker = await readWorkerPid(daemon);
await openDaemonOverview(page, daemon);
await restartDaemonInSettings(page);
await expectDaemonRestartComplete(page);
expect(await readWorkerPid(daemon)).not.toBe(previousWorker);
expect(daemon.getPid()).toBe(supervisor);
await page.screenshot({ path: testInfo.outputPath("restart-confirmed.png"), fullPage: true });
} finally {
await daemon.close();
}
});