test(plugins): cover dead-PID stale runtime-deps lock removal · openclaw/openclaw@016f5ae
masatohoshin
·
2026-04-29
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2104,6 +2104,28 @@ describe("ensureBundledPluginRuntimeDeps", () => {
|
2104 | 2104 | ).toBe(false); |
2105 | 2105 | }); |
2106 | 2106 | |
| 2107 | +it("expires runtime-deps install locks whose owner PID is dead", () => { |
| 2108 | +expect( |
| 2109 | +bundledRuntimeDepsTesting.shouldRemoveRuntimeDepsLock( |
| 2110 | +// Conventional non-existent PID for dead-process simulation |
| 2111 | +{ pid: 99999, createdAtMs: 0 }, |
| 2112 | +1_000, |
| 2113 | +() => false, |
| 2114 | +), |
| 2115 | +).toBe(true); |
| 2116 | +}); |
| 2117 | + |
| 2118 | +it("expires runtime-deps install locks whose owner PID is dead regardless of age", () => { |
| 2119 | +expect( |
| 2120 | +bundledRuntimeDepsTesting.shouldRemoveRuntimeDepsLock( |
| 2121 | +// Conventional non-existent PID for dead-process simulation |
| 2122 | +{ pid: 99999, createdAtMs: Date.now() }, |
| 2123 | +Date.now(), |
| 2124 | +() => false, |
| 2125 | +), |
| 2126 | +).toBe(true); |
| 2127 | +}); |
| 2128 | + |
2107 | 2129 | it("does not expire fresh ownerless runtime-deps install locks", () => { |
2108 | 2130 | expect( |
2109 | 2131 | bundledRuntimeDepsTesting.shouldRemoveRuntimeDepsLock( |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。