From 2343e5692595ae9c08ce7de5bb91460118e67ed2 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sat, 14 Nov 2026 05:36:39 -0500 Subject: [PATCH] test: model open -W in the UI lane and drop the pyc wall-clock bound The native UI verifier now removes its fixture root only after `open -W` exits on its own (67ce671d66). The lane test's `open` stand-in stayed alive until the test released it, so every case waited out the grace period, retained the root and failed on the Apple E2E job. The stand-in now exits when its fixture exits, as `open -W` does. The shared-descendant pyc case bounded wall-clock time at 5 s; it runs in ~0.5 s locally but 4-7 s on loaded CI shards and failed scheduled runs. The retained-heap bound and exact object counts already detect the per-wrapper copy regression, so the host-speed assertion is removed. Co-Authored-By: Claude Opus 5.5 --- src/python/PythonPycParser.test.ts | 5 ++--- tests/boundary/process/nativeUiVerifierLane.test.ts | 7 ++++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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 = `