Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions e2e/slow-agent-device.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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);
},
);

Expand Down
Loading