Skip to content

fix(ci): replace chromium netlink binary patch with LD_PRELOAD shim, upgrade Playwright to 1.60.0#9385

Open
fatih-acar wants to merge 2 commits into
stablefrom
fac-upgrade-playwright
Open

fix(ci): replace chromium netlink binary patch with LD_PRELOAD shim, upgrade Playwright to 1.60.0#9385
fatih-acar wants to merge 2 commits into
stablefrom
fac-upgrade-playwright

Conversation

@fatih-acar
Copy link
Copy Markdown
Contributor

@fatih-acar fatih-acar commented May 29, 2026

Summary

Two commits:

  1. ci: replace the chromium netlink binary patch with an LD_PRELOAD shim. The E2E job worked around ERR_NETWORK_CHANGED flake (Docker/veth netlink churn on the runners) by patching the installed chrome binary: objdump to locate net::internal::AddressTrackerLinux::ReadMessages(...), then dd an 0xc3 (x86 RET) over its first instruction. That offset detection depends on an exact unstripped mangled symbol and the --no-shell binary layout — both of which newer Playwright/Chromium builds change, so the patch breaks. Replaced with an LD_PRELOAD shim (frontend/app/tests/e2e/fixtures/no_netlink.c, ported from styrmin) that fails NETLINK_ROUTE sockets with EAFNOSUPPORT at the libc level, so AddressTrackerLinux::Init takes its graceful "assume always online" path. Version-independent — it never inspects the chromium binary.

  2. test: upgrade Playwright 1.56.1 → 1.60.0 (latest stable): @playwright/test + the playwright/playwright-core pnpm overrides, refreshed lockfile, and the AGENTS.md tech-stack note.

Ordered shim-first so the version bump doesn't ride on the already-broken dd patch.

Implementation notes

  • The shim is compiled in CI (gcc -shared -fPIC … -ldl) and exported as NO_NETLINK_SO. playwright.config.ts injects it via launchOptions.env scoped to the browser process only, so it doesn't leak into node/pnpm subprocesses (whose libuv interface enumeration also uses NETLINK_ROUTE).
  • The lockfile change is surgical — only the Playwright version + 3 integrity hashes (20 lines). A plain pnpm install additionally re-tidied unrelated schema-visualizer/@xyflow entries (pnpm 10.33 cosmetic reformatting), which --frozen-lockfile does not require; that churn was kept out.

Verification

  • Shim compiles clean and exports socket.
  • playwright.config.ts loads and enumerates 245 tests with and without NO_NETLINK_SO; Biome clean.
  • pnpm install --frozen-lockfile passes and resolves @playwright/test 1.60.0; pnpm exec playwright install chromium --no-shell downloads the 1.60.0 build (Chrome for Testing 148).
  • Local checks ran on arm64; CI runs x86_64 (the swap is arch-independent). Authoritative check is the E2E-testing-playwright job.

🤖 Generated with Claude Code


Summary by cubic

Replaced the brittle Chromium binary patch with an LD_PRELOAD shim to stop netlink churn from causing E2E flakes, and upgraded Playwright to 1.60.0.

  • Bug Fixes

    • Removed the objdump/dd Chrome patch; build a no_netlink.so shim in CI and export NO_NETLINK_SO.
    • Inject the shim via launchOptions.env.LD_PRELOAD in playwright.config.ts, scoped to the browser process only.
    • The shim blocks NETLINK_ROUTE sockets so Chromium assumes “always online,” eliminating ERR_NETWORK_CHANGED flakes.
  • Dependencies

    • Upgraded @playwright/test to 1.60.0 with playwright/playwright-core overrides.
    • Updated the lockfile and the testing version in AGENTS.md.

Written for commit 2a321bb. Summary will update on new commits.

Review in cubic

fatih-acar and others added 2 commits May 29, 2026 10:38
The E2E job patched the installed chrome binary (objdump to find
net::internal::AddressTrackerLinux::ReadMessages, then dd an 0xc3 RET over
it) to dodge ERR_NETWORK_CHANGED flake from Docker/veth netlink churn on the
runners. That offset detection depends on an exact mangled symbol and binary
layout, both of which newer Playwright/Chromium builds change, so the patch
breaks.

Replace it with an LD_PRELOAD shim (no_netlink.c) that fails NETLINK_ROUTE
sockets with EAFNOSUPPORT at the libc level, so AddressTrackerLinux::Init
takes its graceful "assume always online" path. This is version-independent
since it never inspects the chromium binary. The shim is compiled in CI and
injected into the browser process only, via playwright.config.ts launchOptions
keyed on NO_NETLINK_SO, keeping it out of node/pnpm subprocesses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bump @playwright/test and the playwright/playwright-core pnpm overrides from
1.56.1 to 1.60.0 (latest stable), refresh the lockfile, and update the
tech-stack note in AGENTS.md. The netlink LD_PRELOAD shim added in the prior
commit replaces the binary patching that broke on newer Chromium builds, so
the upgrade no longer depends on it.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added group/frontend Issue related to the frontend (React) group/ci Issue related to the CI pipeline labels May 29, 2026
@fatih-acar fatih-acar changed the title test: replace chromium netlink binary patch with LD_PRELOAD shim, upgrade Playwright to 1.60.0 fix(ci): replace chromium netlink binary patch with LD_PRELOAD shim, upgrade Playwright to 1.60.0 May 29, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. This PR fixes a flaky E2E test infrastructure issue by replacing a brittle chromium binary patch with a robust, version-independent LD_PRELOAD shim and upgrading Playwright to a minor stable release, with all changes scoped to CI and test configuration and no impact on production code.

Re-trigger cubic

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 29, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing fac-upgrade-playwright (2a321bb) with stable (92e0ef1)

Open in CodSpeed

@fatih-acar fatih-acar marked this pull request as ready for review May 29, 2026 09:34
@fatih-acar fatih-acar requested a review from a team as a code owner May 29, 2026 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

group/ci Issue related to the CI pipeline group/frontend Issue related to the frontend (React)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant