Skip to content

Fix CI e2e flakes: section links in Chromium, and 4K video in WebKit - #108

Merged
RobbieTheWagner merged 2 commits into
media-redesignfrom
test/ci-flakes
Dec 1, 2026
Merged

RobbieTheWagner merged 2 commits into
media-redesignfrom
test/ci-flakes

Conversation

@RobbieTheWagner

@RobbieTheWagner RobbieTheWagner commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

Why

The goal is to merge media-redesign into main with confidence. Several e2e tests pass locally but fail or flake in CI. This PR fixes the cause I could pin down for each one. It also reports the one it only partly fixes.

What changed

  • Section links (Chromium). The section bar marked the current section from Chromium's :target-current. Under CPU load, Chromium stops updating that value. With 4x CDP throttling it stayed on the section the page had just scrolled away from in 5 of 6 runs. At 6x it never left "Notes", even after scrollTo and a wheel scroll. aria-current copied that value, so it got stuck too, and so did the indicator. This matches CI: the stale value was "Transcript" at scrollY 2798 when "More episodes" was clicked. The fix runs the script path that Firefox and WebKit already used (the last section whose top has reached the bar) in every browser, and anchors the indicator to aria-current. This deletes the scroll-target-group branch, its utility and its variant.
  • hls.js level (WebKit). hls.js now uses capLevelToPlayerSize: true. Before, it decoded 3840x2160 into the corner picture. In the CI Playwright image (WebKit on Linux uses hls.js), that one page held the 4-CPU container at about 400% CPU. Capped, the corner plays 240p.

Verification

  • Throttled section probe (chromium, reduced motion, /230, clicking every link). Before: 0/6 failed at 1x, 5/6 at 4x, 4/4 at 6x. After: 0/6 at 1x, 4x and 6x.
  • episode.spec section tests on chromium, --repeat-each=10 --workers=8: 70/70 passed. All of episode.spec across the 3 browsers: 82 passed, 1 failed. The failure was the firefox landscape-phone test, which passed 5/5 when rerun alone. My change does not touch the Firefox path.
  • WebKit in mcr.microsoft.com/playwright:v1.60.0-noble (docker, 4 CPUs, 2 workers), full suite. Before: 3 failed (player :220, player :275, explorer :707) in 8.4m. With the cap: 2 failed (player :49, player-phone :81) in 6.3m. This is one run each, so it is not conclusive. See below.
  • pnpm lint clean. vitest 277/277. pnpm build 0 errors. player*.spec on chromium and firefox: 18/18.

Not fixed

In the CI image, WebKit renders in software at about 10 fps while anything plays, even audio only. Running animations (scrubber particles, card progress transitions, on-air bars) make each frame cost about 100ms. Tests that play media sit at 17 to 26s of a 30s budget, and they starve the other worker. That is what times out the ⌘K palette tests and player :220/:275 under load. One full WebKit run with --workers=1 had all of those pass (1 unrelated failure, 10.3m). I did not change the worker count on a single run.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Improvements
    • The episode navigation indicator now tracks the section that has reached the bar consistently across browsers.
    • Video playback now limits stream quality to match the player’s size.
  • Bug Fixes
    • Current-section navigation styling and positioning now stay in sync as you scroll.

RobbieTheWagner and others added 2 commits November 30, 2026 16:26
Under CPU load Chromium stops updating :target-current: with 4x CDP
throttling it stayed on the section scrolled away from after a link click
(5/6 runs), and at 6x it never left Notes, even after programmatic scrolls
and a wheel scroll. aria-current mirrored it, so the indicator and
aria-current both stuck. CI's episode.spec section-link tests failed on
this in Chromium only (the one browser with scroll-target-group).

Firefox and WebKit already tracked the section in the script (the last
section whose top reached the bar's line). Use that path everywhere and
anchor the indicator to aria-current.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hls.js climbed to the 2160p rendition for the corner picture (measured
3840x2160 decoded into a picture a few hundred pixels wide), which costs
viewers bandwidth and, in CI's software-decoding WebKit, all four cores.
Capped, the corner plays 240p and the level rises when the picture grows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
starpod Ready Ready Preview Nov 30, 2026 9:29pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The episode bar now uses aria-current and intersection-observer tracking to identify the current section in all browsers. The hls.js instance also enables player-size level capping.

Changes: Episode section tracking

Layer / File(s) Summary
Current link and section tracking
packages/starpod/src/components/episode/SectionBar.astro, packages/starpod/src/styles/episode.css, packages/starpod/src/styles/utilities.css, packages/starpod/DESIGN.md
The bar marks its current link with aria-current and uses the existing intersection-observer path in all browsers. The scroll-target-group utility and target-current variant are removed. The design documentation describes the section selection rule.

HLS player sizing

Layer / File(s) Summary
HLS instance configuration
packages/starpod/src/components/media/engine.ts
The hls.js instance enables capLevelToPlayerSize and retains its configured start position.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to 524c1

Episode section links now use one tracking path in every browser, and the corner video player caps its quality to its size. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names both principal changes in the PR: the Chromium section-link fix (replacing stale :target-current tracking with the script-based path, anchored on aria-current) and the WebKit 4K video …
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 both principal changes in the PR: the Chromium section-link fix (replacing stale :target-current tracking with the script-based path, anchored on aria-current) and the WebKit 4K video fix (hls.js capLevelToPlayerSize). The changeset matches both halves, and the 'Fix CI e2e flakes' framing matches the stated objective of making the end-to-end tests more reliable. The title is specific and single-sentence, though at 13 words it is slightly long.

Finishing Touches

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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8bdf42d and 524c1f7.

Files selected for processing: 5

  • packages/starpod/DESIGN.md
  • packages/starpod/src/components/episode/SectionBar.astro
  • packages/starpod/src/components/media/engine.ts
  • packages/starpod/src/styles/episode.css
  • packages/starpod/src/styles/utilities.css
Files with no reviewable changes: 1

  • packages/starpod/src/styles/utilities.css

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

@RobbieTheWagner
RobbieTheWagner merged commit 1134aa0 into media-redesign Dec 1, 2026
9 checks passed

This branch was successfully deployed

1 active deployment
Preview — 524c1f7c Deployed Nov 30, 2026 by vercel[bot]
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.

1 participant