Skip to content

fix(v3/windows): raise the WebView2 embed timeout to 60s - #6043

Merged
leaanthony merged 1 commit into
wailsapp:masterfrom
Grantmartin2002:bugfix/webview2_embed_timeout_60s
Aug 26, 2026
Merged

fix(v3/windows): raise the WebView2 embed timeout to 60s#6043
leaanthony merged 1 commit into
wailsapp:masterfrom
Grantmartin2002:bugfix/webview2_embed_timeout_60s

Conversation

@Grantmartin2002

@Grantmartin2002 Grantmartin2002 commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Description

This run failed with:

=== RUN   TestCookieManager
[WebView2 Error] timed out after 30s waiting for the WebView2 controller; the WebView2 runtime did not complete initialisation
FAIL	github.com/wailsapp/wails/v3/internal/webview2/pkg/edge	46.880s

A cold WebView2 launch creates the user data folder and spawns the browser process tree, and on CI it does that while go test ./... saturates the runner. Isolated on the same commit the test passes in ~10s, so 30s is simply tight rather than wrong.

embedTimeout is a backstop for a callback that never arrives, not a startup budget (its own comment says so), and it costs nothing when initialisation succeeds because pumpUntilInited returns as soon as the controller is ready. Raised to 60s.

Fixes #6042

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

GOOS=windows go build ./internal/webview2/... and go vet on the package. Vet reports two pre-existing possible misuse of unsafe.Pointer warnings, unchanged by this commit (confirmed by stashing it). The Windows CI leg on this PR runs TestCookieManager itself.

  • Windows
  • macOS
  • Linux

Cross-compiled and vetted from macOS. I have no Windows machine to run the test on, so the PR's Windows leg is the real check.

Test Configuration

Cross-compile only, GOOS=windows GOARCH=amd64, Go 1.25.

Checklist:

  • (v2 only) I have updated website/src/pages/changelog.mdx with details of this PR (v3 changelog entries are added automatically)
  • My code follows the general coding style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

The affected test is Windows-only, so I could not run it locally; no new test added since this changes a constant.

Summary by CodeRabbit

  • Bug Fixes
    • Increased the WebView2 initialization timeout to improve reliability on slower startup environments.

A cold WebView2 launch on a loaded CI runner occasionally takes longer
than 30s, so Embed gave up and TestCookieManager failed. The timeout is
a backstop for a callback that never arrives, not a startup budget, and
it costs nothing when initialisation succeeds.
@github-actions github-actions Bot added the v3 label Aug 26, 2026
@coderabbitai

coderabbitai Bot commented Aug 26, 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 79fe2ac6-72d9-4746-b3ad-3d4156351250

📥 Commits

Reviewing files that changed from the base of the PR and between 45f4f9d and ba0f9f9.

📒 Files selected for processing (1)
  • v3/internal/webview2/pkg/edge/chromium.go

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


Walkthrough

The WebView2 controller initialization timeout increases from 30 seconds to 60 seconds.

Changes

WebView2 timeout

Layer / File(s) Summary
Increase controller initialization timeout
v3/internal/webview2/pkg/edge/chromium.go
embedTimeout now permits up to 60 seconds for WebView2 controller initialization.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to ba0f9

This localized change only extends the WebView2 initialization timeout to accommodate slow cold starts; no actionable merge-blocking risk remains beyond normal checks and review.

Poem

A rabbit watched the timer glow

Thirty ticks were not enough to go
Sixty now guard the loading gate
WebView2 can take its time to wake
The controller arrives, no hurry—great!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change directly satisfies issue #6042 by increasing the fixed WebView2 embedTimeout from 30 seconds to 60 seconds. Successful initialization still returns immediately.
Out of Scope Changes check ✅ Passed The pull request changes only the WebView2 controller initialization timeout, which directly matches issue #6042 and the stated objectives. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Title check ✅ Passed The title clearly and concisely describes the main change: increasing the WebView2 embed timeout to 60 seconds in the v3 Windows implementation.
Description check ✅ Passed The description explains the failure, motivation, implementation, linked issue, testing performed, test limitations, configuration, and checklist status. It identifies that Windows-only tests could no…
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

Full details: Description check

Explanation

The description explains the failure, motivation, implementation, linked issue, testing performed, test limitations, configuration, and checklist status. It identifies that Windows-only tests could not run locally and that Windows CI provides validation.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@leaanthony
leaanthony merged commit 5967524 into wailsapp:master Aug 26, 2026
65 checks passed
leaanthony pushed a commit that referenced this pull request Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestCookieManager flakes on Windows CI: 30s embed timeout too tight under load

2 participants