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(guardrails): give the PowerShell key-file tests time on Windows by terisuke · Pull Request #380 · Cor-Incorporated/opencode

Conversation

@terisuke

@terisuke terisuke commented Nov 6, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Issue for this PR

Closes #379

Type of change

  • Test fix

What does this PR do?

dev(98256dbc89)の unit (windows) が、cor-local-env.js: key file validation > (d) … の 5 秒 timeout(5019 ms)で落ちています(run 41999813160)。同じテストは #377 の Windows の job でも落ちました。#369 の run では 3457 ms で、かろうじて通っていました。

原因は処理時間です。Windows では、テストの keyPermissions が Windows PowerShell(Set-Acl)を起動し、テスト対象のコードも本番の ACL 検査のために PowerShell をもう一度起動します。最初の起動だけで 3.4〜5 秒かかります。

PowerShell を起動する 7 本のテストに、理由をコメントした 30 秒の per-test timeout を付けました。unit-tests スキルの「時間がかかる正当な処理には per-test timeout と、その処理を名指しするコメント」に従っています。テストの中身は変えていません(diff の大半は prettier の折り返しです)。macOS と Linux では chmod だけなので、所要時間は変わりません。

How did you verify your code works?

  • ローカル(macOS): bun test profile/src/cor-local-bin-defaults.test.ts で 23 pass / 0 fail。
  • この PR の unit (windows)(f219db301a、run 42153860016)は pass。問題のテスト (d) は 5672.80 ms かかっていて、旧来の 5 秒なら落ちていた。
  • 独立レビューは CRITICAL/HIGH 0。指摘への対応は 2 つ目の commit 320a061d3c です。
    • MEDIUM: テスト全体の予算を上げた結果、補助関数自身の spawnSync の 5 秒が、最初の(冷えた)PowerShell の起動を打ち切りうる上限になっていた。20 秒に上げ、失敗時のメッセージに signal を出す。
    • LOW: コメントの所要時間をログに合わせた(最初のテストの 2 回の起動で 3.2〜6.0 秒、17 回中 5 回で 5 秒超え)。POWERSHELL を POWERSHELL_TIMEOUT に改名した。
    • 残した LOW(本番コードの別件で、持ち主の判断に回す): 本番の ACL 検査が冷えた起動で 5 秒を超えると、本当の拒否と同じ "invalid format" になり、区別できない。

H5-E2E: none

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

🤖 Generated with Claude Code

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
terisuke and others added 3 commits November 6, 2026 12:00
@terisuke @claude
test(guardrails): give the PowerShell key-file tests time on Windows
f219db3
On Windows each keyPermissions call starts Windows PowerShell (Set-Acl) and
the code under test starts it again for the production ACL probe. The first
cold start alone takes 3.4-5 s on the windows runner, so "(d)
group/other-readable key file is ignored" timed out at bun's 5 s default on
dev 98256db (run 41999813160). The seven tests that start PowerShell get
a 30 s per-test timeout with a comment naming the work, as the unit-tests
skill asks; elsewhere they still take milliseconds.

Closes #379

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Agent-Lane: claude-code
@terisuke @claude
test(guardrails): let the test budget, not the helper, bound a cold P…
320a061
…owerShell start

Review of #380 (follow-up to f219db3):

- With the per-test budget raised, the helper's own 5 s spawnSync timeout
  became the limit for the file's first (cold) PowerShell start; it would
  fail as "Received: null" with an empty message. It now allows 20 s and the
  assertion names the signal.
- The comment's timings now match the runner logs (the first test's two
  starts took 3.2-6.0 s and exceeded 5 s in 5 of 17 runs).
- POWERSHELL becomes POWERSHELL_TIMEOUT, so it no longer reads like the
  executable path.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Agent-Lane: claude-code
@terisuke @claude
docs(guardrails): say "exceeded" in the PowerShell timeout comment
e2499bb
Second review of #380: "passed bun's 5 s default" could read as "the test
passed", and the 3.4 s figure was the next test (two starts), not a single
start.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Agent-Lane: claude-code
@terisuke
terisuke merged commit 78f2e49 into dev Nov 6, 2026
16 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Windows の unit で PowerShell を起動する鍵ファイルのテストが 5 秒を超えて落ちる

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@terisuke
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — 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.