Skip to content

fix(e2e): capture daemon startup logs before window ready - #10040

Merged
AmethystLiang merged 1 commit into
mainfrom
fix-e2e-tests-3
Jul 23, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
fix-e2e-tests-3

Conversation

@AmethystLiang

Copy link
Copy Markdown
Contributor

Summary

The daemon health-check guard emits its preservation/replace decision during main-process startup, before the renderer window is ready. A post-launch stderr listener would miss these logs, causing the test to fail intermittently.

Changes

  • Add onStderr option to session.launch() that attaches the stderr listener before firstWindow() resolves, ensuring main-process startup logs are captured
  • Update the test assertion from an exact string match to a case-insensitive regex pattern (/preserv\w*\s+daemon[^\n]*health check/i) that is resilient to benign wording changes in the log message
  • Add a complementary assertion to confirm the "replace" path was never taken

Testing

E2E test daemon-slow-health-check-preservation.spec.ts now reliably captures daemon guard decision logs and passes consistently.

The daemon health-check guard logs during main-process startup, which can
complete before the renderer window resolves. Moved stderr listening to the
launch options so early logs aren't missed. Also made the assertion regex
pattern-based instead of exact-string matching to tolerate benign log
rewording, and added a check that the replace path stayed off.
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bd8f0f7a-c4cc-4a25-b178-98f48733c97c

📥 Commits

Reviewing files that changed from the base of the PR and between 0326594 and 214efc5.

📒 Files selected for processing (2)
  • tests/e2e/daemon-slow-health-check-preservation.spec.ts
  • tests/e2e/helpers/orca-restart.ts

📝 Walkthrough

Walkthrough

The restart helper now accepts an optional onStderr callback and forwards Electron startup stderr before creating the first window. The daemon health-check preservation test uses this callback to collect stderr and verifies preservation with a case-insensitive semantic regex while asserting that daemon replacement was not logged.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning Missing required template sections like Screenshots, AI Review Report, Security Audit, and Notes; Testing also lacks the requested checklist format. Add all required headings from the template, fill the testing checklist items, include the cross-platform review, security audit, and any platform-specific notes.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: capturing daemon startup logs before the window is ready.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@AmethystLiang
AmethystLiang merged commit 5b7fdd7 into main Jul 23, 2026
5 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…#10040)

The daemon health-check guard logs during main-process startup, which can
complete before the renderer window resolves. Moved stderr listening to the
launch options so early logs aren't missed. Also made the assertion regex
pattern-based instead of exact-string matching to tolerate benign log
rewording, and added a check that the replace path stayed off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant