Skip to content

Commit 6f508d5

Browse files
authored
test: deflake runner cancel test (#25021)
1 parent 61dfae3 commit 6f508d5

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

packages/opencode/test/effect/runner.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,16 @@ describe("Runner", () => {
115115
Effect.gen(function* () {
116116
const s = yield* Scope.Scope
117117
const runner = Runner.make<string>(s)
118-
const fiber = yield* runner.ensureRunning(Effect.never.pipe(Effect.as("never"))).pipe(Effect.forkChild)
119-
yield* Effect.sleep("10 millis")
118+
const started = yield* Deferred.make<void>()
119+
const fiber = yield* runner
120+
.ensureRunning(
121+
Effect.gen(function* () {
122+
yield* Deferred.succeed(started, void 0)
123+
return yield* Effect.never.pipe(Effect.as("never"))
124+
}),
125+
)
126+
.pipe(Effect.forkChild)
127+
yield* Deferred.await(started)
120128
expect(runner.busy).toBe(true)
121129
expect(runner.state._tag).toBe("Running")
122130

0 commit comments

Comments
 (0)