Crash tests fail with the Chromium sandbox on Linux

未关闭
#44,094 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@microsoft-playwright-automation 已经在做这个了。

开始于 2026年11月13日。

  • #44102 来自 @microsoft-playwright-automation —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
github-actions, playwright, typescript

调研方向

Start with tests/mcp/crash.spec.ts and the sandbox flags in packages/playwright-core/src/tools/mcp/config.ts; compare the failing MCP tests with the passing CDP crash test in tests/mcp/cli-cdp.spec.ts. Run the crash tests on Linux Chrome with --no-sandbox to test the reported hypothesis, then investigate the renderer crash event and revisit the skips in tests/mcp/crash.spec.ts and tests/library/page-event-crash.spec.ts. Done means the cause is identified and the skips match the condition that requires them.

由索引模型根据 Issue 内容生成。

描述

agent-triage needs-triage

The page crash event does not arrive when Chrome runs with the Chromium sandbox on Linux. This is an inference from the bot results below. No run has tested Chrome on Linux with only the sandbox changed.

Failing tests

The three tests in tests/mcp/crash.spec.ts fail on the ubuntu-latest - chrome MCP job in every run on main since 12 November (13 of 13 runs).

The crash event never arrives:

1) [chrome] › tests/mcp/crash.spec.ts:31:3 › crash recovery › reports the navigation error, then resets and logs the crash
   Error: Test timeout of 30000ms exceeded
     47 |       expect(log).toContain('Page crashed and was reset to about:blank.');
   > 48 |     }).toPass();

2) [chrome] › tests/mcp/crash.spec.ts:58:3 › crash recovery › lists only one tab
   Test timeout of 30000ms exceeded.
   Error: Not connected

3) [chrome] › tests/mcp/crash.spec.ts:79:3 › crash recovery › marks non-current crashed tab in the tab list
   Test timeout of 30000ms exceeded.
   Error: Not connected

In tests 2 and 3, page.waitForEvent('crash') after page.goto('chrome://crash') does not resolve.

Why the sandbox

On Linux, the MCP server starts --browser=chrome with the sandbox on and --browser=chromium with the sandbox off (config.ts#L235-L242). The library starts all browsers with the sandbox off.

Crash tests on the Linux MCP bots, main, 6 to 13 November:

Test Browser Started by Sandbox Ubuntu 26.04 Ubuntu 24.04
mcp/crash.spec.ts (3 tests) Chrome stable MCP server on 0 of 13 passed skipped
mcp/crash.spec.ts (3 tests) Chromium MCP server off 13 of 13 passed skipped
attach via cdp with a crashed page Chrome stable library off 13 of 13 passed 47 of 47 passed
attach via cdp with a crashed page Chromium library off 13 of 13 passed 48 of 48 passed
  • attach via cdp with a crashed page runs in the same job with the same Chrome stable. It navigates to chrome://crash, waits for the crash event, and passes. Thus the Chrome build is not the cause.
  • That test also passed on Ubuntu 24.04 with Chrome and with Chromium. Thus the Ubuntu version is probably not the cause, and the ubuntu24.04 skip names the wrong condition.
  • Chrome on macOS and Windows passes mcp/crash.spec.ts with the sandbox on. Only Linux has the problem.
Skips to examine again
  • tests/mcp/crash.spec.ts#L22: skip on ubuntu24.04, added in #40617.
  • tests/library/page-event-crash.spec.ts#L40: the same skip for Chromium on ubuntu24.04, added in #40156. The library runs with the sandbox off, so this skip does not agree with the sandbox explanation. It is possibly out of date, or specific to the playwright-x64-ubuntu24-64-core machines.
Next steps
  • Run tests/mcp/crash.spec.ts with --no-sandbox on the Linux Chrome bot to confirm that the sandbox is the cause.
  • Replace the ubuntu24.04 skips with the correct condition.
  • Find why a sandboxed Chrome on Linux does not report the renderer crash. The job reports have no browser output or MCP server output.
主要语言
TypeScript
星标
99.7k
派生
6.8k
平均合并
16 小时 10 分钟
30 天内合并 PR
301

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/playwright 的其他 Issue

查看 microsoft/playwright 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。