mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:00:43 +00:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user