Skip to content

Fix flaky CI tests by adding retry logic and increasing timeouts - #15635

Merged
AmethystLiang merged 2 commits into
mainfrom
fix-ci-tests
Aug 20, 2026
Merged

AmethystLiang merged 2 commits into
mainfrom
fix-ci-tests

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​35 $\color{#cf222e}{\Huge{\mathbf{−}}}$​16 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19
Prod 0 0 0 0

Problem

Two tests fail intermittently on CI runners due to timing and system load:

  1. browser-cookie-import-partition.electron.test.ts: Electron launch never reaches 'ready' state before watchdog timeout, especially on busy runners
  2. skill-install-lock.test.ts: Lock acquisition timeout (100ms) expires before fsync + retry cycle completes under load

Solution

browser-cookie-import-partition.electron.test.ts:

  • Retry Electron fixture up to 2 attempts if launch gets stuck in 'starting' state (detected via watchdog message)
  • Use fresh profile directory per attempt to avoid bias from incomplete initialization
  • Increase test timeout from 90s to 150s

skill-install-lock.test.ts:

  • Increase lock acquisition timeout from 100ms to 5s to allow fsync + retry cycle to complete

ELI5

Some tests fail randomly on busy CI runners. We added retry logic to restart Electron when it hangs, and we gave lock acquisition more time to complete its work.

What Changed

  • browser-cookie-import-partition.electron.test.ts: Added retry mechanism for flaky Electron launches with fresh profiles per attempt, increased timeout
  • skill-install-lock.test.ts: Increased lock acquisition timeout from 100ms to 5s

Why

CI runners are sometimes busy or slow, causing tests to fail due to timing issues rather than actual bugs. Retrying transient Electron launch failures and allowing sufficient time for system operations reduces flakiness without masking real issues.

Linked Issue

Fixes #

Visual Proof

N/A — test-only changes with no UI or behavior modifications

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

Add Electron launch retry for CI runners where startup wedges before
reaching 'ready', with fresh profile per attempt to avoid mid-init state.
Increase skill install lock timeout from 100ms to 5s to account for
fsync cost plus retry duration on loaded CI runners.
@coderabbitai

coderabbitai Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f6cc44b8-a3bc-4d14-b787-739d90d27f51

📥 Commits

Reviewing files that changed from the base of the PR and between 64e6570 and 496765d.

📒 Files selected for processing (1)
  • src/main/browser/browser-cookie-import-partition.electron.test.ts

📝 Walkthrough

Walkthrough

Electron fixture tests now detect startup timeouts before ready and retry once with a fresh user-data directory. Other fixture failures remain fatal, and the enclosing test timeout increased to 150 seconds. The legacy skill lock reclamation test now uses a 5-second acquisition timeout and includes an explanatory comment.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: retry logic and increased timeouts for flaky CI tests.
Description check ✅ Passed The description explains the problem, solution, scope, and rationale, but the required linked issue and testing details are incomplete.
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.

@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.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8a9e8798-2791-409e-86d5-77025ac400d9

📥 Commits

Reviewing files that changed from the base of the PR and between 6e25a90 and 64e6570.

📒 Files selected for processing (2)
  • src/main/browser/browser-cookie-import-partition.electron.test.ts
  • src/main/skills/skill-install-lock.test.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.

@AmethystLiang
AmethystLiang merged commit 4e058d4 into main Aug 20, 2026
3 checks passed
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 23, 2026
…blyai#15635)

* Fix flaky CI tests by adding retry logic and increasing timeouts

Add Electron launch retry for CI runners where startup wedges before
reaching 'ready', with fresh profile per attempt to avoid mid-init state.
Increase skill install lock timeout from 100ms to 5s to account for
fsync cost plus retry duration on loaded CI runners.

* shorten comments

(cherry picked from commit 4e058d4)
dallascrilley pushed a commit to dallascrilley/orca that referenced this pull request Aug 27, 2026
…blyai#15635)

* Fix flaky CI tests by adding retry logic and increasing timeouts

Add Electron launch retry for CI runners where startup wedges before
reaching 'ready', with fresh profile per attempt to avoid mid-init state.
Increase skill install lock timeout from 100ms to 5s to account for
fsync cost plus retry duration on loaded CI runners.

* shorten comments
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…blyai#15635)

* Fix flaky CI tests by adding retry logic and increasing timeouts

Add Electron launch retry for CI runners where startup wedges before
reaching 'ready', with fresh profile per attempt to avoid mid-init state.
Increase skill install lock timeout from 100ms to 5s to account for
fsync cost plus retry duration on loaded CI runners.

* shorten comments
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