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)))
|
yield* Effect.addFinalizer(() => Effect.sync(() => GlobalBus.off("event", on)))
|
||||||
|
|
||||||
return Deferred.await(ready).pipe(
|
return Deferred.await(ready).pipe(
|
||||||
Effect.race(
|
Effect.timeoutOrElse({
|
||||||
Effect.sleep("10 seconds").pipe(
|
duration: "10 seconds",
|
||||||
Effect.flatMap(() => Effect.fail(new Error("timed out waiting for worktree.ready"))),
|
orElse: () => Effect.fail(new Error("timed out waiting for worktree.ready")),
|
||||||
),
|
}),
|
||||||
),
|
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue