test(plugins): cover dead-PID stale runtime-deps lock removal

Adds focused regression coverage for dead owner PID runtime-deps install locks so stale lock recovery remains PID-first and does not wait on age when the recorded owner process is gone.

Co-authored-by: masatohoshino <g515hoshino@gmail.com>
This commit is contained in:
Masato Hoshino
2026-04-29 20:51:14 +09:00
committed by GitHub
parent fc49f94ccf
commit 016f5ae862

View File

@@ -2104,6 +2104,28 @@ describe("ensureBundledPluginRuntimeDeps", () => {
).toBe(false);
});
it("expires runtime-deps install locks whose owner PID is dead", () => {
expect(
bundledRuntimeDepsTesting.shouldRemoveRuntimeDepsLock(
// Conventional non-existent PID for dead-process simulation
{ pid: 99999, createdAtMs: 0 },
1_000,
() => false,
),
).toBe(true);
});
it("expires runtime-deps install locks whose owner PID is dead regardless of age", () => {
expect(
bundledRuntimeDepsTesting.shouldRemoveRuntimeDepsLock(
// Conventional non-existent PID for dead-process simulation
{ pid: 99999, createdAtMs: Date.now() },
Date.now(),
() => false,
),
).toBe(true);
});
it("does not expire fresh ownerless runtime-deps install locks", () => {
expect(
bundledRuntimeDepsTesting.shouldRemoveRuntimeDepsLock(