GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(opencode): retry Windows CLI cleanup · soequelle/opencode@9b01f15

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/opencode/test
    • lib
      • cli-process.ts
    • server
      • httpapi-sdk.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/opencode/test/lib/cli-process.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/lib/cli-process.ts
+8-4Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import { test, type TestOptions } from "bun:test"
2121
import { FSUtil } from "@opencode-ai/core/fs-util"
2222
import { AppProcess } from "@opencode-ai/core/process"
23-
import { Deferred, Duration, Effect, Layer, Queue, Scope, Stream } from "effect"
23+
import { Deferred, Duration, Effect, Layer, Queue, Schedule, Scope, Stream } from "effect"
2424
import { FetchHttpClient, HttpClient } from "effect/unstable/http"
2525
import { ChildProcess } from "effect/unstable/process"
2626
import path from "node:path"
@@ -192,9 +192,13 @@ export function withCliFixture<A, E>(
192192
const fs = yield* FSUtil.Service
193193
const appProc = yield* AppProcess.Service
194194

195-
// FileSystem.makeTempDirectoryScoped handles both creation and scope-tied
196-
// cleanup — replaces the old mkdir + addFinalizer pair.
197-
const home = yield* fs.makeTempDirectoryScoped({ prefix: "oc-cli-" })
195+
const home = yield* fs.makeTempDirectory({ prefix: "oc-cli-" })
196+
yield* Effect.addFinalizer(() =>
197+
fs.remove(home, { recursive: true }).pipe(
198+
Effect.retry(Schedule.spaced("50 millis").pipe(Schedule.both(Schedule.recurs(20)))),
199+
Effect.ignore,
200+
),
201+
)
198202

199203
const configJson = JSON.stringify(testProviderConfig(llm.url))
200204
const env = isolatedEnv(home, configJson)
Collapse file

‎packages/opencode/test/server/httpapi-sdk.test.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/test/server/httpapi-sdk.test.ts
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { TestLLMServer } from "../lib/llm-server"
2222
import path from "path"
2323
import { resetDatabase } from "../fixture/db"
2424
import { disposeAllInstances, TestInstance, tmpdirScoped } from "../fixture/fixture"
25-
import { awaitWithTimeout, testEffect } from "../lib/effect"
25+
import { awaitWithTimeout, pollWithTimeout, testEffect } from "../lib/effect"
2626
import { testProviderConfig } from "../lib/test-provider"
2727
import { ProviderV2 } from "@opencode-ai/core/provider"
2828
import { ModelV2 } from "@opencode-ai/core/model"
@@ -389,7 +389,12 @@ describe("HttpApi SDK", () => {
389389
workspaceID,
390390
onRequest: (value) => (request = value),
391391
})
392-
const found = yield* call(() => sdk.v2.fs.find({ query: "hello", type: "file" }))
392+
const found = yield* pollWithTimeout(
393+
call(() => sdk.v2.fs.find({ query: "hello", type: "file" })).pipe(
394+
Effect.map((result) => (result.data?.data.length ? result : undefined)),
395+
),
396+
"SDK file search index was not ready",
397+
)
393398
const url = new URL(request!.url)
394399

395400
expect(found.response.status).toBe(200)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.