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: deflake shutdown-deadline cleanup and PowerShell permission tim… · abn/opencode@5f1f8d0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages
    • cli/test
      • shutdown-deadline.test.ts
    • core/test
      • tool-shell.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/cli/test/shutdown-deadline.test.ts‎

Copy file name to clipboardExpand all lines: packages/cli/test/shutdown-deadline.test.ts
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ async function hang(
4646
await body(proc, pid)
4747
} finally {
4848
proc.kill("SIGKILL")
49-
if (running(pid)) process.kill(pid, "SIGKILL")
49+
kill(pid)
5050
}
5151
}
5252

@@ -63,12 +63,12 @@ async function readLine(stream: ReadableStream<Uint8Array>, prefix: string) {
6363
}
6464
}
6565

66-
function running(pid: number) {
67-
if (!Number.isSafeInteger(pid) || pid <= 0) return false
66+
// The fixture's child can exit between any liveness check and the kill, so a missing process is not an error.
67+
function kill(pid: number) {
68+
if (!Number.isSafeInteger(pid) || pid <= 0) return
6869
try {
69-
process.kill(pid, 0)
70-
return true
71-
} catch {
72-
return false
70+
process.kill(pid, "SIGKILL")
71+
} catch (error) {
72+
if ((error as NodeJS.ErrnoException).code !== "ESRCH") throw error
7373
}
7474
}
Collapse file

‎packages/core/test/tool-shell.test.ts‎

Copy file name to clipboardExpand all lines: packages/core/test/tool-shell.test.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ const withScanner = <A, E, R>(
257257
(tmp) => Effect.promise(() => tmp[Symbol.asyncDispose]().then(() => undefined)),
258258
)
259259

260+
// The timeout catches a hung permission flow, not slowness: PowerShell commands on loaded Windows runners have exceeded 5s.
260261
const runPermissionCommand = (
261262
registry: Tool.Interface,
262263
command: string,
@@ -287,7 +288,7 @@ const runPermissionCommand = (
287288
expect(yield* permission.list()).toEqual([])
288289
expect(yield* Queue.size(queue)).toBe(0)
289290
return { exit, requests }
290-
}).pipe(Effect.scoped, Effect.timeout(Duration.seconds(5)))
291+
}).pipe(Effect.scoped, Effect.timeout(Duration.seconds(15)))
291292

292293
// Directory cases still document inherited limitations; fixed scanner cases require matching behavior.
293294
describe("ShellTool scanner permissions", () => {

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.