From 3680d33d11320704ad20abc5dd94cf80bbfd656c Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 4 Jun 2026 02:18:05 -0400 Subject: [PATCH] test(opencode): wait for share sync flush --- packages/opencode/test/share/share-next.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/opencode/test/share/share-next.test.ts b/packages/opencode/test/share/share-next.test.ts index feb070a09cb..168243abb52 100644 --- a/packages/opencode/test/share/share-next.test.ts +++ b/packages/opencode/test/share/share-next.test.ts @@ -18,7 +18,7 @@ import { Database } from "@opencode-ai/core/database/database" import { eq } from "drizzle-orm" import { provideTmpdirInstance } from "../fixture/fixture" import { resetDatabase } from "../fixture/db" -import { testEffect } from "../lib/effect" +import { pollWithTimeout, testEffect } from "../lib/effect" const env = Layer.mergeAll( Session.defaultLayer, @@ -301,7 +301,11 @@ describe("ShareNext", () => { }, ], }) - yield* Effect.sleep(1_250) + yield* pollWithTimeout( + Effect.sync(() => (seen.length === 1 ? true : undefined)), + "timed out waiting for share sync", + "5 seconds", + ) expect(seen).toHaveLength(1) expect(seen[0].url).toBe("https://legacy-share.example.com/api/share/shr_abc/sync")