mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-11-30 17:14:54 +01:00
test: await connection setup and persisted runtime identity
Complete the dialog fixture context and wait for the actual setup render. Observe the post-spawn PID update before checking the starting service identity, preserving provisioning and readiness assertions. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
1 parent
3a12ec4bef
commit
ed3a0df1c1
2 files changed
+43
-3
No files matched your search
@@ -6636,7 +6636,7 @@ describeEmbeddedPostgres("workspace runtime service control persistence", () =>
|
||||
}
|
||||
throw new Error("Timed out waiting for runtime service process marker");
|
||||
};
|
||||
const waitForPersistedStatus = async (status: string) => {
|
||||
const waitForPersistedStatus = async (status: string, requireProviderRef = false) => {
|
||||
const deadline = Date.now() + 5_000;
|
||||
while (Date.now() < deadline) {
|
||||
const row = await db
|
||||
@@ -6644,7 +6644,9 @@ describeEmbeddedPostgres("workspace runtime service control persistence", () =>
|
||||
.from(workspaceRuntimeServices)
|
||||
.where(eq(workspaceRuntimeServices.executionWorkspaceId, executionWorkspaceId))
|
||||
.then((rows) => rows[0] ?? null);
|
||||
if (row?.status === status) return row;
|
||||
// The provisional starting row is durable before spawn; the child can
|
||||
// write its marker before the subsequent PID update reaches the DB.
|
||||
if (row?.status === status && (!requireProviderRef || /^\d+$/.test(row.providerRef ?? ""))) return row;
|
||||
await new Promise((resolve) => setTimeout(resolve, 25));
|
||||
}
|
||||
throw new Error(`Timed out waiting for persisted runtime service status ${status}`);
|
||||
@@ -6711,7 +6713,7 @@ describeEmbeddedPostgres("workspace runtime service control persistence", () =>
|
||||
expect(existsSync(markerPath)).toBe(false);
|
||||
|
||||
await waitForMarker(markerPath);
|
||||
const startingRow = await waitForPersistedStatus("starting");
|
||||
const startingRow = await waitForPersistedStatus("starting", true);
|
||||
expect(startingRow).toMatchObject({
|
||||
companyId,
|
||||
projectId,
|
||||
|
||||
Reference in new issue
Block a user