mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-17 12:42:17 +00:00
test(worktree): use timeoutOrElse for ready wait (#27180)
This commit is contained in:
parent
1d243ce25a
commit
d0844c600b
1 changed files with 4 additions and 5 deletions
|
|
@ -29,11 +29,10 @@ const waitReady = Effect.fn("WorktreeTest.waitReady")(function* () {
|
|||
yield* Effect.addFinalizer(() => Effect.sync(() => GlobalBus.off("event", on)))
|
||||
|
||||
return Deferred.await(ready).pipe(
|
||||
Effect.race(
|
||||
Effect.sleep("10 seconds").pipe(
|
||||
Effect.flatMap(() => Effect.fail(new Error("timed out waiting for worktree.ready"))),
|
||||
),
|
||||
),
|
||||
Effect.timeoutOrElse({
|
||||
duration: "10 seconds",
|
||||
orElse: () => Effect.fail(new Error("timed out waiting for worktree.ready")),
|
||||
}),
|
||||
)
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue