fix(process): normalize macOS launcher identity
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
type ProcessOwnershipHost,
|
||||
type WindowsProcessTreeHost,
|
||||
} from "../src/process/ProcessOwnership.js";
|
||||
import { matchesOwnedProcessCommand } from "../src/process/ProcessCommandIdentity.js";
|
||||
|
||||
const ownership = {
|
||||
runId: "run-token",
|
||||
@@ -61,6 +62,30 @@ describe("owned process-group cleanup", () => {
|
||||
).toEqual({ REA_PROCESS_RUN_ID: "owned", EMPTY: "" });
|
||||
});
|
||||
|
||||
it("matches macOS executable names after process-table normalization", () => {
|
||||
expect(
|
||||
matchesOwnedProcessCommand(
|
||||
"node /tmp/fake-launcher.mjs",
|
||||
"/opt/node/bin/node",
|
||||
"darwin",
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
matchesOwnedProcessCommand(
|
||||
"node /tmp/fake-launcher.mjs",
|
||||
"/opt/python/bin/python3",
|
||||
"darwin",
|
||||
),
|
||||
).toBe(false);
|
||||
expect(
|
||||
matchesOwnedProcessCommand(
|
||||
"node /tmp/fake-launcher.mjs",
|
||||
"/opt/node/bin/node",
|
||||
"linux",
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("signals only a group whose every member carries the run token", async () => {
|
||||
const { adapter, signalGroup } = host({
|
||||
100: { REA_PROCESS_RUN_ID: "run-token" },
|
||||
|
||||
Reference in New Issue
Block a user