Skip to content

[web] Filter non-fatal Chromium D-Bus error lines from Chrome stderr - #190669

Merged
auto-submit[bot] merged 9 commits into
flutter:masterfrom
mdebbar:fix-chrome-dbus-address
Aug 13, 2026
Merged

auto-submit[bot] merged 9 commits into
flutter:masterfrom
mdebbar:fix-chrome-dbus-address

Conversation

@mdebbar

@mdebbar mdebbar commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

This PR updates the Chrome launcher environment setup in flutter_tools, devicelab, and web_ui (felt) on Linux.

When running headless Chrome tests in a Linux container or VM without a desktop environment, Chromium attempts to connect to the D-Bus system daemon (for things like desktop notifications and system themes) and prints benign but annoying error logs to stderr when it fails (e.g. ERROR:dbus/bus.cc, Failed to connect to the bus).

This PR filters out these non-fatal D-Bus connection error messages emitted by Chromium. This follows the industry standard pattern used by other open source projects to filter out stderr noise in E2E tests (e.g., exocortex).

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Aug 6, 2026

@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 configures the DBUS_SESSION_BUS_ADDRESS environment variable to unix:path=/dev/null when launching Chromium on Linux if it is missing, empty, or set to /dev/null. Feedback on the changes suggests refactoring to avoid duplication: specifically, removing the redundant kChromeLinuxArgs constant in the tests in favor of kChromeArgs, and extracting the duplicated environment setup logic in chrome.dart into a shared private helper getter.

Comment thread packages/flutter_tools/test/web.shard/chrome_test.dart Outdated
Comment thread packages/flutter_tools/test/web.shard/chrome_test.dart Outdated
Comment thread packages/flutter_tools/test/web.shard/chrome_test.dart Outdated
Comment thread engine/src/flutter/lib/web_ui/dev/chrome.dart Outdated
Comment thread engine/src/flutter/lib/web_ui/dev/chrome.dart Outdated
@mdebbar mdebbar changed the title Set valid DBUS_SESSION_BUS_ADDRESS syntax in Chrome launchers [web] Set valid DBUS_SESSION_BUS_ADDRESS syntax in Chrome launchers Aug 6, 2026
@mdebbar
mdebbar force-pushed the fix-chrome-dbus-address branch from 31a2b73 to 5a4c9b5 Compare August 6, 2026 19:19
@mdebbar mdebbar changed the title [web] Set valid DBUS_SESSION_BUS_ADDRESS syntax in Chrome launchers Filter out non-fatal Chromium D-Bus error lines from Chrome stderr output Aug 6, 2026
@mdebbar mdebbar changed the title Filter out non-fatal Chromium D-Bus error lines from Chrome stderr output [web] Filter non-fatal Chromium D-Bus error lines from Chrome stderr Aug 6, 2026
@github-actions github-actions Bot added tool Affects the "flutter" command-line tool. See also t: labels. engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team labels Aug 6, 2026
@mdebbar
mdebbar requested a review from harryterkelsen August 11, 2026 18:00

@harryterkelsen harryterkelsen 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.

LGTM

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 12, 2026
/// We filter out these benign D-Bus lines to prevent stderr log noise in CI,
/// following the industry standard pattern used by open source projects to filter
/// E2E test logs (e.g. https://github.com/kitelev/exocortex/blob/4290cdade669034e5f71c892fb3e1908c5a2fe12/packages/obsidian-plugin/docker-entrypoint-e2e.sh#L48-L49).
bool _isDbusError(String line) {

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.

SO MUCH identical code. Any reasonable place to allow sharing?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I filed this issue some time ago: #176051. I agree this duplication isn't great.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Aug 12, 2026
@auto-submit

auto-submit Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/190669, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 13, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Aug 13, 2026
Merged via the queue into flutter:master with commit 639fb1c Aug 13, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants