diff --git a/src/python/PythonPycParser.test.ts b/src/python/PythonPycParser.test.ts index 26a81f15db..2c37f97a28 100644 --- a/src/python/PythonPycParser.test.ts +++ b/src/python/PythonPycParser.test.ts @@ -1265,11 +1265,10 @@ it("keeps one descendant list when many wrappers share a container", () => { marshalCode("py311", { constsObject: Buffer.concat(pieces) }), ]); const before = process.memoryUsage().heapUsed; - const started = Date.now(); const report = parseWith(bytes, { max_objects: 65_536 }); const retained = process.memoryUsage().heapUsed - before; - // 1,800 children and 14,000 wrappers: 49,612 reads, previously ~181 MiB. - expect(Date.now() - started).toBeLessThan(5000); + // 1,800 children and 14,000 wrappers: 49,612 reads. A copied list per wrapper + // previously retained ~181 MiB; retention, not host speed, shows the sharing. expect(retained).toBeLessThan(64 * 1024 * 1024); expect(report.coverage.objects).toBe(49_612); expect(report.code_objects).toHaveLength(children + 1); diff --git a/tests/boundary/process/nativeUiVerifierLane.test.ts b/tests/boundary/process/nativeUiVerifierLane.test.ts index 5ddf216c58..01b219762e 100644 --- a/tests/boundary/process/nativeUiVerifierLane.test.ts +++ b/tests/boundary/process/nativeUiVerifierLane.test.ts @@ -10,8 +10,9 @@ import { systemProcessOwnershipHost } from "../../../src/process/ProcessOwnershi import { liveProcesses } from "../../../src/process/ProcessOwnershipProcessTree.js"; import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js"; -// Stands in for /usr/bin/open: starts a detached app that inherits its environment. -// Each stand-in records itself and leaves when the test releases it, or expires. +// Stands in for /usr/bin/open -W: starts a detached app that inherits its +// environment and exits once that app exits. Each stand-in records itself and +// leaves when the test releases it, or expires. const standInPrelude = ` import { appendFileSync, existsSync, readFileSync } from "node:fs"; const config = JSON.parse(readFileSync(new URL("./config.json", import.meta.url), "utf8")); @@ -32,7 +33,7 @@ const coordinates = args[args.indexOf("--stdout") + 1]; spawn(process.execPath, [new URL("./fixture.mjs", import.meta.url).pathname], { detached: true, stdio: ["ignore", openSync(coordinates, "a"), "ignore"], -}).unref(); +}).once("exit", () => process.exit(0)); `; const fixtureSource = `