test(opencode): wait for share sync flush

This commit is contained in:
Dax Raad
2026-06-04 02:18:05 -04:00
parent 0b3d0a5b52
commit 3680d33d11
@@ -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")