From 5c870a768a195d4637da235ee7499bf221d815b8 Mon Sep 17 00:00:00 2001 From: Szymon Chmal Date: Sun, 15 Nov 2026 18:34:49 +0100 Subject: [PATCH] test: the agent-device daemon kill leaves the agent's lease on the same device (#1577) --- e2e/slow-agent-device.test.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/e2e/slow-agent-device.test.ts b/e2e/slow-agent-device.test.ts index ea1eaeda4..c6a7d24e6 100644 --- a/e2e/slow-agent-device.test.ts +++ b/e2e/slow-agent-device.test.ts @@ -487,11 +487,13 @@ function defineSuite(target: Target): void { ); leasingCase( - "when the agent-device daemon is killed, a new one with a new pid runs; the agent's next command fails with lease ended by simlock, and its simlock lease is released", + "when the agent-device daemon is killed, a new one with a new pid runs; the agent opens the installed Appduct fixture app again and takes a snapshot, and its simlock lease stays, on the same device", { timeout: 900_000 }, async () => { const a = await agent("a"); ok(await open(a)); + ok(await a.run(["install", "Appduct", target.app])); + const [lease] = await listLeases(env); const old = await readPidRecord(env); process.kill(old.pid, "SIGKILL"); await waitFor( @@ -503,14 +505,12 @@ function defineSuite(target: Target): void { ); await awaitAgentDevice(); - const next = await a.run(["snapshot"]); - expect(next.code).not.toBe(0); - expect(failureText(next)).toContain("lease ended by simlock"); - await waitFor(async () => (await listLeases(env)).length === 0, { - timeout: 60_000, - interval: 500, - label: "a's simlock lease released", - }); + ok(await a.run(["open", target.bundleId])); + ok(await a.run(["snapshot"], FIRST_SNAPSHOT)); + const leases = await listLeases(env); + expect(leases).toHaveLength(1); + expect(leases[0]?.id).toBe(lease?.id); + expect(leases[0]?.deviceId).toBe(lease?.deviceId); }, );