Skip to content

Use "headless" flag in web tests for LUCI - #10075

Merged
srawlins merged 1 commit into
flutter:masterfrom
srawlins:more-headless
Nov 4, 2026
Merged

srawlins merged 1 commit into
flutter:masterfrom
srawlins:more-headless

Conversation

@srawlins

@srawlins srawlins commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Work towards #9995

This LUCI log shows a failure for the integration tests on Linux: https://ci.chromium.org/ui/p/dart/builders/try/devtools-linux-release-x64-try/90?

The root cause is that when testing against a Flutter Web target (DEVICE=flutter-web), DevTools launches a fixture test app using flutter run --machine -d chrome --no-devtools, without the --web-run-headless flag. On LUCI Linux
bots (Ubuntu 24.04 Noble running headlessly without $DISPLAY), Chrome aborts immediately on launch because unprivileged user namespaces are restricted by AppArmor and --no-sandbox was not supplied.

Because --web-run-headless was omitted:

  1. flutter_tools attempted to start Chrome in GUI mode with sandboxing enabled.
  2. In the LUCI environment (SWARMING_BOT_ID: luci-dart-try-noble-..., Ubuntu 24.04, SWARMING_HEADLESS: 1, no $DISPLAY), AppArmor blocks unprivileged user namespaces.
  3. Chrome crashed on startup:

    [CHROME STDERR]: [FATAL:zygote_host_impl_linux.cc:144] No usable sandbox! If you are running on Ubuntu 23.10+ or another Linux distro that has disabled unprivileged user namespaces with AppArmor, see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for running web integration tests headlessly. It adds a headless parameter to the TestFlutterApp constructor and passes the --web-run-headless flag when running on Chrome if headless mode is enabled. I have reviewed the changes and have no feedback to provide.

@srawlins
srawlins requested a review from johnpryan November 4, 2026 17:19
@srawlins
srawlins merged commit 84fb7cc into flutter:master Nov 4, 2026
52 checks passed
@srawlins
srawlins deleted the more-headless branch November 4, 2026 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants