test(opencode): wait for share sync flush
This commit is contained in:
parent
0b3d0a5b52
commit
3680d33d11
1 changed files with 6 additions and 2 deletions
|
|
@ -18,7 +18,7 @@ import { Database } from "@opencode-ai/core/database/database"
|
||||||
import { eq } from "drizzle-orm"
|
import { eq } from "drizzle-orm"
|
||||||
import { provideTmpdirInstance } from "../fixture/fixture"
|
import { provideTmpdirInstance } from "../fixture/fixture"
|
||||||
import { resetDatabase } from "../fixture/db"
|
import { resetDatabase } from "../fixture/db"
|
||||||
import { testEffect } from "../lib/effect"
|
import { pollWithTimeout, testEffect } from "../lib/effect"
|
||||||
|
|
||||||
const env = Layer.mergeAll(
|
const env = Layer.mergeAll(
|
||||||
Session.defaultLayer,
|
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).toHaveLength(1)
|
||||||
expect(seen[0].url).toBe("https://legacy-share.example.com/api/share/shr_abc/sync")
|
expect(seen[0].url).toBe("https://legacy-share.example.com/api/share/shr_abc/sync")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue