test(connections): wait for committed agent readiness

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-26 09:13:07 -05:00
1 parent ff5084a8ae
commit 2d90f92137
1 file changed
+1 -1
@@ -61,7 +61,7 @@ describe("connection management with production default agents", () => {
expect(agent, JSON.stringify(agent)).toHaveProperty("id");
expect(created.status).toBe(201);
await lifecycle.process(agent.id);
expect((await agentService(server.db).getById(agent.id))?.status).toBe("idle");
await vi.waitFor(async () => expect((await agentService(server.db).getById(agent.id))?.status).toBe("idle"), { timeout: 10_000 });
await server.db.update(heartbeatRuns).set({ agentId: agent.id }).where(eq(heartbeatRuns.id, base.runId));
await server.db.update(issues).set({ assigneeAgentId: agent.id, responsibleUserId: userId }).where(eq(issues.id, base.issueId));
const key = await agentService(server.db).createApiKey(agent.id, "integration", { kind: "standard" }, { responsibleUserId: userId });