Skip to content

fix(ci): stabilize recent dev smoke flakes - #933

Closed
Astro-Han wants to merge 1 commit into
devfrom
codex/ci-flake-stabilize-v2
Closed

fix(ci): stabilize recent dev smoke flakes#933
Astro-Han wants to merge 1 commit into
devfrom
codex/ci-flake-stabilize-v2

Conversation

@Astro-Han

Copy link
Copy Markdown
Owner

Summary

Fixes two recent merged dev CI flakes without changing product behavior:

  • Adds a bounded shutdown fallback to the desktop report-problem smoke script so a successful smoke result cannot hang until the workflow timeout.
  • Keeps the slow same-step loop-gate live test on the default timeout outside Windows, while giving Windows a 30s budget after it exceeded the 10s default by milliseconds.

No issue exists; this came from live investigation of the latest merged dev CI failures.

Why

Recent merged dev runs showed two separate failure shapes:

  • desktop-smoke on 2a6d53d completed the report-problem assertions and printed a ready result, then stayed alive until GitHub cancelled the job at 30 minutes.
  • windows-advisory on 9d1b7a8 failed only because loop gate records same-step repeated tool errors without block or stop timed out at 10.016s on Windows.

Related Issue

None.

Human Review Status

Pending

Review Focus

Please check that the smoke-script shutdown fallback is scoped to test cleanup only, and that the timeout increase stays limited to the known slow Windows live test.

Risk Notes

No product runtime behavior changes. Platform impact considered: this touches macOS Electron smoke cleanup and Windows advisory test timing only. Manual workflow_dispatch for windows-advisory was attempted after the review cleanup, but GitHub returned HTTP 500 for Actions dispatch creation; the Windows-specific path remains covered by the platform-gated test change and will be rechecked on the next dispatchable Windows advisory run.

How To Verify

GitHub Actions log inspection: latest merged dev failures were desktop-smoke cancellation after successful report result, and windows-advisory timeout in one prompt-effect live test.
Focused prompt test: cd packages/opencode && bun test --timeout 30000 test/session/prompt-effect.test.ts -t "loop gate records same-step repeated tool errors without block or stop" -> 1 pass.
Workflow contract tests: cd packages/opencode && bun test test/github/desktop-smoke-workflow.test.ts test/github/ci-workflow.test.ts -> 12 pass.
Desktop build: cd packages/desktop-electron && bun run build -> passed.
Report smoke: cd packages/desktop-electron && perl -e 'alarm shift; exec @ARGV' 25 bun run smoke:report -> passed and exited with code 0.
Diff check: git diff --check -> passed.

Screenshots or Recordings

Not applicable; no visible UI changes.

Checklist

  • Type label — this PR carries exactly one of bug, enhancement, task, documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.
  • Routing labels — this PR carries at least one of app, ui, platform, harness, ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.
  • Priority label — this PR carries exactly one of P0, P1, P2, P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.
  • Human Review Status above is set to Pending, Approved by @<reviewer>, or Not required: <reason> (default is Pending; "not required" is restricted to bot-authored low-risk PRs).
  • I linked the related issue, or stated in Summary why there is no issue.
  • I described the review focus and any meaningful risks.
  • I replaced the example block in How To Verify with the real verification steps and the key result for each.
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope.
  • (conditional) I manually checked visible UI or copy changes when needed, with screenshots or recordings. Leave unticked only if no visible UI or copy changed.
  • (conditional) I considered macOS and Windows impact for platform, packaging, updater, signing, paths, shell, or permissions changes. Leave unticked only if no platform/packaging surface was touched.
  • (conditional) I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant. Leave unticked only if none of those surfaces was touched.
  • 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

  • Bug Fixes

    • Enhanced application shutdown reliability on desktop with improved process management and robust termination handling.
  • Tests

    • Improved test stability on Windows with optimized timeout configuration.

Review Change Stack

@Astro-Han Astro-Han added bug Something isn't working ci Continuous integration / GitHub Actions windows Windows-specific P1 High priority desktop labels May 26, 2026
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@Astro-Han, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 34 minutes and 55 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d5b78dd3-dec9-4f59-866f-22659d780e77

📥 Commits

Reviewing files that changed from the base of the PR and between bafb19b and 8cf5a57.

📒 Files selected for processing (2)
  • packages/desktop-electron/scripts/report-problem-smoke.mjs
  • packages/opencode/test/session/prompt-effect.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ci-flake-stabilize-v2

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.

@Astro-Han

Copy link
Copy Markdown
Owner Author

Closing duplicate trigger PR. GitHub did not create Actions check suites for this PR either, so #930 remains the canonical PR for this fix.

@Astro-Han Astro-Han closed this May 26, 2026
@Astro-Han
Astro-Han deleted the codex/ci-flake-stabilize-v2 branch May 26, 2026 11:21

@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 introduces a more robust application teardown process in the desktop-electron smoke test script by implementing helper functions to handle timeouts, wait for process exits, and force-kill the application if it fails to close gracefully. Additionally, it increases the test timeout specifically for Windows environments in the opencode session tests to prevent flaky failures. The review feedback suggests adding a defensive check in childIsRunning to prevent a potential TypeError if the child process is undefined.

Comment on lines +58 to +60
function childIsRunning(child) {
return child.exitCode === null && child.signalCode === null
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Add a defensive check to ensure child is defined before accessing its properties. If app.process() returns undefined or null (e.g., if the application failed to launch or has already been completely disposed), this function will throw a TypeError.

function childIsRunning(child) {
  return child && child.exitCode === null && child.signalCode === null
}

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

Labels

bug Something isn't working ci Continuous integration / GitHub Actions desktop P1 High priority windows Windows-specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant