Skip to content

test(opencode): bump prompt-effect busy/idle timeout for windows runner#543

Merged
Astro-Han merged 2 commits into
devfrom
fix/prompt-effect-busy-idle-timeout-windows
May 11, 2026
Merged

test(opencode): bump prompt-effect busy/idle timeout for windows runner#543
Astro-Han merged 2 commits into
devfrom
fix/prompt-effect-busy-idle-timeout-windows

Conversation

@Astro-Han

@Astro-Han Astro-Han commented May 11, 2026

Copy link
Copy Markdown
Owner

Summary

Increase the timeout for the Windows-sensitive loop sets status to busy then idle prompt-effect test from 3s to 5s.

Why

The latest dev Windows advisory run failed in packages/opencode/test/session/prompt-effect.test.ts because this test timed out after 3015ms against a 3000ms budget. This file already has a precedent for Windows runner timing headroom in a3b8e5456 test(windows): unblock 4 prompt-effect timeouts under runner load; this PR applies the same bounded fix to the remaining busy/idle status test.

Related Issue

task #19 / Windows advisory CI failure on dev

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

  • Confirm the change is limited to the timeout constant for loop sets status to busy then idle.
  • Confirm this does not change test behavior or product code.
  • Confirm Windows advisory CI turns green.

Risk Notes

Low risk. Test-only timeout headroom for a Windows advisory timing edge. No product behavior, runtime code, dependencies, or generated files changed.

How To Verify

Focused prompt-effect test file: 48 passed
Opencode typecheck: passed
Diff check: no whitespace errors
Diff scope: 1 file changed, 1 insertion, 1 deletion

Screenshots or Recordings

Not applicable. This is a test-only timeout adjustment.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, primary area, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

Summary by CodeRabbit

  • Tests
    • Updated test timeout configuration to improve test stability and reduce flakiness.

Note: This release contains test infrastructure updates only. No user-facing changes.

Review Change Stack

@Astro-Han Astro-Han added flaky-test Non-deterministic test failure harness Model harness, prompts, tool descriptions, and session mechanics windows Windows-specific P3 Low priority task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work labels May 11, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request increases a test timeout in prompt-effect.test.ts from 3,000ms to 5,000ms. The reviewer suggests replacing the hardcoded value with the slowIOTimeout constant to maintain consistency across platforms and improve test efficiency.

Comment thread packages/opencode/test/session/prompt-effect.test.ts Outdated
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@Astro-Han has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 43 minutes and 36 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 37401a43-abde-40c2-984f-6995a8fb501c

📥 Commits

Reviewing files that changed from the base of the PR and between e42deef and 9ae178d.

📒 Files selected for processing (1)
  • packages/opencode/test/session/prompt-effect.test.ts
📝 Walkthrough

Walkthrough

Test timeout for the "loop sets status to busy then idle" test case increased from 3000 to 5000 milliseconds to provide additional execution time. Test logic and assertions remain unchanged.

Changes

Test Timeout Adjustment

Layer / File(s) Summary
Test Timeout Configuration
packages/opencode/test/session/prompt-effect.test.ts
Test timeout for "loop sets status to busy then idle" increased from 3_000 to 5_000 milliseconds.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • Astro-Han/pawwork#148: Both PRs modify timeouts in the same test file for loop-related tests.
  • Astro-Han/pawwork#429: Both PRs modify timeouts in packages/opencode/test/session/prompt-effect.test.ts for slow IO test cases.

Suggested labels

ci

Poem

🐰 A tick here, a tick there,
More time to spare, with utmost care,
Five thousand beats for loops so fair,
No rush, no stress, the tests declare!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: increasing a test timeout for the Windows runner to fix a flaky test.
Description check ✅ Passed The description follows the template comprehensively, includes all required sections with detailed context, and includes a completed checklist confirming adherence to repository standards.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/prompt-effect-busy-idle-timeout-windows

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/opencode/test/session/prompt-effect.test.ts (1)

1204-1204: ⚡ Quick win

Use platform-specific timeout to match established pattern.

The PR description indicates this is a Windows-specific timing issue, but the fix applies a 5s timeout universally. The file already establishes a pattern for Windows-sensitive timeouts at lines 223 and 1812 (slowIOTimeout and shellQueueTimeout), both using process.platform === "win32" ? 10_000 : 3_000.

Consider using a platform-specific timeout to avoid unnecessary delay on non-Windows platforms.

⚡ Proposed platform-specific timeout
-  5_000,
+  process.platform === "win32" ? 5_000 : 3_000,
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/opencode/test/session/prompt-effect.test.ts` at line 1204, Replace
the hardcoded 5_000 timeout with the established platform-specific pattern used
elsewhere (see slowIOTimeout and shellQueueTimeout) by using process.platform
=== "win32" ? 10_000 : 3_000 so Windows gets the longer timeout and other
platforms keep the shorter one; locate the numeric literal near the failing test
in prompt-effect.test.ts and swap it for the platform-conditional expression to
match existing timeouts.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/opencode/test/session/prompt-effect.test.ts`:
- Line 1204: Replace the hardcoded 5_000 timeout with the established
platform-specific pattern used elsewhere (see slowIOTimeout and
shellQueueTimeout) by using process.platform === "win32" ? 10_000 : 3_000 so
Windows gets the longer timeout and other platforms keep the shorter one; locate
the numeric literal near the failing test in prompt-effect.test.ts and swap it
for the platform-conditional expression to match existing timeouts.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 742b235f-5bbe-4fa0-b0f7-cb99b8958c54

📥 Commits

Reviewing files that changed from the base of the PR and between a09311c and e42deef.

📒 Files selected for processing (1)
  • packages/opencode/test/session/prompt-effect.test.ts

@Astro-Han Astro-Han merged commit 577233b into dev May 11, 2026
20 checks passed
@Astro-Han Astro-Han deleted the fix/prompt-effect-busy-idle-timeout-windows branch May 11, 2026 08:34
Astro-Han added a commit that referenced this pull request May 15, 2026
…656)

Why
windows-advisory has been flaking at ~55% on dev push (27 failures /
50 runs in the latest sample). bun's default 3s it.live timeout is
consistently tight on the Windows runner for Effect-fiber + SQLite +
tmpdir-server tests in packages/opencode/test/session/prompt-effect.test.ts.
Four prior PRs (#543, a3b8e54, cf6d1cd, #579) each bumped one or two
tests at a time to a slowIOTimeout constant without converging — today's
failure on "cancel records MessageAbortedError on interrupted process"
was the fifth instance of the same root cause.

What
Wrap testEffect's live runner via withDefaultLiveTimeout so every
it.live in prompt-effect.test.ts picks up a Windows-aware default
(10s Windows / 3s elsewhere). Remove 12 third-arg timeout literals
(5 x 3_000, 5 x slowIOTimeout, 2 x shellQueueTimeout) and the two
duplicated `const ... Timeout` definitions. The wrapper also covers
.only and .skip for symmetry. Explicit non-default timeouts
(5_000, 10_000, 30_000) still override.

Out of scope
bun 1.3.13 watcher.node segfault on Windows process exit, and transient
actions/cache failures, are upstream / infra and intentionally left to
fail "normally" per d6fa1e6. The advisory workflow is not in branch
protection and existing if: always() artifact and summary uploads
preserve the diagnostic signal.

Verification
- tsgo --noEmit: clean
- bun test test/session/prompt-effect.test.ts --timeout 30000:
  54 pass / 0 fail / 28.69s (macOS)
- bun test test/github/ci-workflow.test.ts --timeout 30000:
  9 pass / 0 fail
- PR CI on 4d4792c: all green (typecheck, lint, unit-app, unit-desktop,
  unit-opencode, e2e-artifacts, smoke-macos-arm64, analyze-js-ts, CodeQL)

Review follow-ups
Gemini suggested also wrapping .only / .skip; applied and thread
resolved. An external review flagged a P1 about .only not being
wrapped; audited against HEAD and the claim referenced the pre-amend
version (8ad2c1a), not the current 4d4792c — no change required.

Risk
Detection of a true hang on Windows live tests now takes up to 10s
rather than 3s. Acceptable for an advisory signal. No production code
paths touched. windows-advisory will still show occasional red runs
from upstream / infra causes by design.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky-test Non-deterministic test failure harness Model harness, prompts, tool descriptions, and session mechanics P3 Low priority task Narrow execution, audit, spike, migration, tracking, or upstream follow-up work windows Windows-specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant