Skip to content

test(browser): "removing a connected app" no longer fails one run in three - #377

Merged
PiquelChips merged 1 commit into
mainfrom
fix/connected-app-flake
Nov 5, 2026
Merged

PiquelChips merged 1 commit into
mainfrom
fix/connected-app-flake

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

The browser test "removing a connected app" in settings.spec.ts failed about one run in three with cdpSession.send: Target page, context or browser has been closed, on main as well as on open PRs.

The test ends on the client's callback page, which serveClient serves through DevTools. After that page loads, Chromium asks for https://browser-e2e.test/favicon.ico. Nothing waits for that request, so its fire-and-forget Fetch.fulfillRequest was sometimes still in flight when the test ended and its context closed. The rejected send then failed the test. Logging every paused request showed each failure was that favicon request, answered just after the context had closed.

The page serveClient serves now declares an icon (<link rel="icon" href="data:,">), so Chromium never makes that request. Every request a client page now makes is one its test waits for. The fix is in the helper, not in a retry or a longer timeout, so it covers every spec that serves a client.

Proof, run locally as CI does (Caddy, Mailpit, just web browser-client, the debug binary):

  • Before: 8 of 15 runs failed, all on the favicon request.
  • After: the test passed 20 of 20 runs in a row, and all of settings.spec.ts passed.
  • The other specs that use serveClient also passed: oidc, sdk, related-origins, developers, browser-client and admin.

One unrelated flake came up once along the way, in admin.spec.ts's recovery test (line 551). That test reloads before the undo it just posted is known to have finished. It passes on main and with this change, and is left for a separate fix.

Reviewed with review-loop: 1 round with 2× GPT 6.1 Sol and Claude Opus 5.5. Verdict: approved

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by GPT 6.1 Sol and Claude Opus 5.5 (via T3 Code)

🤖 Generated with Claude Code

Browser test helper

serveClient now includes <link rel="icon" href="data:,"> in the blank client page it serves. The page declares an icon, so Chromium does not request /favicon.ico. This prevents an unawaited favicon request from remaining in flight when the test ends.

The helper’s documentation now describes the icon and the reason for adding it.

…three

The test ends on the client's callback page, which `serveClient` serves
through DevTools. Chromium then asks for that origin's `/favicon.ico`.
Nothing waits for that request, so its `Fetch.fulfillRequest` could still
be in flight when the context closed, and its rejection failed the test
with `cdpSession.send: Target page, context or browser has been closed`.
The served page now declares an icon, so Chromium never makes the request.
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

serveClient now serves a data-URL favicon in its fallback HTML. Its documentation notes that the icon avoids a /favicon.ico request that could leave a pending response during tests.

Changes: Browser helper response

Layer / File(s) Summary
Document and serve the fallback icon
tests/browser/helpers.ts
The serveClient documentation describes the fallback page’s icon and the effect of avoiding a /favicon.ico request. The fallback HTML now includes a data-URL favicon link.

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

Change: Bug fix · Severity of issue fixed: Low

Suggested labels: bug

Merge Risk: Minimal · up to 5a896

The fallback page declares an icon to avoid a separate favicon request. No merge-blocking risk is identified.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names a specific test fix ("removing a connected app" no longer failing intermittently) and the test(browser) scope. The change adds an icon link to the page served by serveClient in tests/b…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
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.
Full details: Title check

Explanation

The title names a specific test fix ("removing a connected app" no longer failing intermittently) and the test(browser) scope. The change adds an icon link to the page served by serveClient in tests/browser/helpers.ts so that Chromium does not issue an unawaited /favicon.ico request. The title describes the outcome and the affected test, not the mechanism, which is acceptable for a short title. It is specific and matches the changeset, though it does not mention the helper change itself. The title is a single sentence, is clear, and fits the scope of the change.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the blank page bright,
A tiny icon greets the sight.
No favicon request waits in line,
The tests can hop along just fine.
The burrow rests; the page looks right.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 924ca876-6e65-4ca6-864d-f2e0e8bb5709
Commits

Reviewing files that changed from the base of the PR and between 09c6ede and 5a8969a.

Files selected for processing: 1

  • tests/browser/helpers.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@PiquelChips PiquelChips self-assigned this Nov 5, 2026
@PiquelChips PiquelChips added the tests Tests label Nov 5, 2026
@PiquelChips PiquelChips added this to the v0.1 milestone Nov 5, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 5, 2026
@PiquelChips PiquelChips moved this from Needs Triage to In Progress in sourceorigin.dev Nov 5, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Ready in sourceorigin.dev Nov 5, 2026
@PiquelChips
PiquelChips merged commit 0bd9312 into main Nov 5, 2026
9 checks passed
@PiquelChips
PiquelChips deleted the fix/connected-app-flake branch November 5, 2026 17:52
@github-project-automation github-project-automation Bot moved this from Ready to Done in sourceorigin.dev Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant