Skip to content

Commit 3dd900d

Browse files
authored
test(opencode): remove disposal event wait race (anomalyco#30971)
1 parent 9f599d6 commit 3dd900d

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/opencode/test/project/instance-bootstrap.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ it.live("CLI bootstrap runs InstanceBootstrap before callback", () =>
8686
it.live("CLI bootstrap disposes the instance when the callback rejects", () =>
8787
Effect.gen(function* () {
8888
const tmp = yield* bootstrapFixture
89-
const disposed = yield* waitDisposed(tmp.directory).pipe(Effect.forkScoped)
89+
const disposed = yield* waitDisposed(tmp.directory).pipe(Effect.forkScoped({ startImmediately: true }))
9090

9191
const exit = yield* Effect.promise(() =>
9292
cliBootstrap(tmp.directory, async () => Promise.reject(new Error("boom"))),

packages/opencode/test/server/httpapi-config.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ describe("config HttpApi", () => {
3737
"serves config update through the default server app",
3838
Effect.gen(function* () {
3939
const tmp = yield* tmpdirEffect({ config: { formatter: false, lsp: false } })
40-
const disposed = yield* waitDisposed(tmp.path).pipe(Effect.forkScoped)
40+
const disposed = yield* waitDisposed(tmp.path).pipe(Effect.forkScoped({ startImmediately: true }))
4141

4242
const response = yield* Effect.promise(() =>
4343
Promise.resolve(

packages/opencode/test/server/httpapi-instance-context.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ describe("HttpApi instance context middleware", () => {
333333
directory: workspaceDir,
334334
})
335335
yield* serveDisposeProbe()
336-
const disposed = yield* waitDisposedEvent.pipe(Effect.forkScoped)
336+
const disposed = yield* waitDisposedEvent.pipe(Effect.forkScoped({ startImmediately: true }))
337337

338338
const response = yield* HttpClientRequest.post(`/dispose-probe?workspace=${workspace.id}`).pipe(
339339
HttpClient.execute,

0 commit comments

Comments
 (0)