test(process): retire native caches at worker teardown
This commit is contained in:
parent
96d3cafb07
commit
a0784c0d2c
|
|
@ -46,6 +46,11 @@ claim, even if a directory name calls it acceptance.
|
||||||
Emit a verifier's final success report only after awaited cleanup. Observe final
|
Emit a verifier's final success report only after awaited cleanup. Observe final
|
||||||
process lineage after closing its owned resources.
|
process lineage after closing its owned resources.
|
||||||
|
|
||||||
|
The Vitest runner releases cached native process inspectors during awaited
|
||||||
|
worker teardown. Fork termination does not run Node's normal exit hooks; a
|
||||||
|
per-file teardown would instead retire shared inspectors before later files
|
||||||
|
can use them.
|
||||||
|
|
||||||
Measure slow files before removing capacity regressions. Optimize repeated
|
Measure slow files before removing capacity regressions. Optimize repeated
|
||||||
process startup, fixture construction, and production algorithms when they
|
process startup, fixture construction, and production algorithms when they
|
||||||
dominate runtime. Keep at least one input beyond each formerly failing size or
|
dominate runtime. Keep at least one input beyond each formerly failing size or
|
||||||
|
|
@ -356,7 +361,7 @@ are separate proof levels.
|
||||||
Synthetic producer regressions run independently:
|
Synthetic producer regressions run independently:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm run test:focused -- tests/boundary/android/jadxIntegration.test.ts tests/boundary/mcp/androidAnalysisMcp.test.ts
|
npm run test:focused -- tests/boundary/process/jadxIntegration.test.ts tests/boundary/process/androidAnalysisMcp.test.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
## Optional NativeAOT Ghidra analysis
|
## Optional NativeAOT Ghidra analysis
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
{
|
{
|
||||||
"$schema": "./node_modules/knip/schema.json",
|
"$schema": "./node_modules/knip/schema.json",
|
||||||
"entry": ["src/main.ts", "src/cli.ts", "src/contracts/errorSchemas.ts"],
|
"entry": [
|
||||||
|
"src/main.ts",
|
||||||
|
"src/cli.ts",
|
||||||
|
"src/contracts/errorSchemas.ts",
|
||||||
|
"tests/processOwnershipRunner.ts"
|
||||||
|
],
|
||||||
"project": ["src/**/*.ts", "tests/**/*.ts", "scripts/**/*.mjs"],
|
"project": ["src/**/*.ts", "tests/**/*.ts", "scripts/**/*.mjs"],
|
||||||
"vitepress": {
|
"vitepress": {
|
||||||
"entry": ["docs/.vitepress/config.ts"]
|
"entry": ["docs/.vitepress/config.ts"]
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
import { TestRunner } from "vitest";
|
||||||
|
|
||||||
|
import type { ProcessOwnershipHost } from "../src/process/ProcessOwnership.js";
|
||||||
|
|
||||||
|
/** Retire each isolated graph's native cache when its test worker stops. */
|
||||||
|
export default class ProcessOwnershipRunner extends TestRunner {
|
||||||
|
readonly #registeredHosts = new WeakSet<ProcessOwnershipHost>();
|
||||||
|
|
||||||
|
async onBeforeRunFiles(): Promise<void> {
|
||||||
|
const { systemProcessOwnershipHost } =
|
||||||
|
await import("../src/process/ProcessOwnershipObservation.js");
|
||||||
|
if (this.#registeredHosts.has(systemProcessOwnershipHost)) return;
|
||||||
|
if (this.onCleanupWorkerContext === undefined)
|
||||||
|
throw new Error("The test pool does not support worker resource cleanup");
|
||||||
|
this.#registeredHosts.add(systemProcessOwnershipHost);
|
||||||
|
this.onCleanupWorkerContext(() => systemProcessOwnershipHost.close?.());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -134,6 +134,7 @@ export default defineConfig({
|
||||||
projects,
|
projects,
|
||||||
retry: 0,
|
retry: 0,
|
||||||
reporters: ["default"],
|
reporters: ["default"],
|
||||||
|
runner: "./tests/processOwnershipRunner.ts",
|
||||||
// Boundary projects may compete with TypeScript, docs, and package checks
|
// Boundary projects may compete with TypeScript, docs, and package checks
|
||||||
// under Turbo. Keep the deadline bounded while avoiding false failures from
|
// under Turbo. Keep the deadline bounded while avoiding false failures from
|
||||||
// host-level CPU and filesystem contention.
|
// host-level CPU and filesystem contention.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue