mirror of
https://github.com/anomalyco/opencode.git
synced 2026-07-24 04:01:10 -04:00
test(opencode): wait for share sync flush
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user