You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linux linux_web_engine_tests is failing somewhat consistently on Firefox #172713
00:30 +756 ~45 -1: text_editing_test.dart: GloballyPositionedTextEditingStrategy keeps focus within window/iframe when the focus moves within the flutter view in Chrome but not Safari [E]
Expected: JSValue:<[object HTMLElement]>
Actual: JSValue:<[object HTMLInputElement]>
text_editing_test.dart.browser_test.dart.wasm 1:305801 module0.Error._throwWithCurrentStackTrace
It's failed 12 of 50 times, and 4 time in a row at HEAD in post-submit, turning the tree 🔴.
I can reproduce the error using the current tip-of-tree on my Linux setup (running Firefox 128.12.0esr)
The test works if I replace the expect(domDocument.activeElement, flutterView.dom.rootElement) check with the expect(domDocument.activeElement, textEditing.strategy.domElement) used for Chromium.
Possibly Firefox has fixed the issue in recent versions? The version of Firefox may not be consistent across all of the LUCI bots, so the test may need to support both behaviors.
Interestingly that package is labeled as version:132.0 on CIPD. But when I run the Firefox binary in the package it identifies itself as version 141.0.
If I set FIREFOX_EXECUTABLE to the binary from CIPD, then the test script launches that version of Firefox as expected. But on my setup I'm still seeing the test pass only when using the Chromium-style expect(domDocument.activeElement, textEditing.strategy.domElement) assertion.
Interestingly that package is labeled as version:132.0 on CIPD. But when I run the Firefox binary in the package it identifies itself as version 141.0.
Are you sure you don't have an existing Firefox installation that's v141.0? When I launched the firefox binary from CIPD, it showed me a dialog asking me if I want to switch to the already installed newer version:
Tried this again on my Linux setup, and it looks like Firefox updated itself.
When I download the CIPD package that is labeled as version:132.0, running firefox --version on the binary in the package prints Mozilla Firefox 132.0.
But running that Firefox for the first time starts an auto update that replaces the binaries extracted from CIPD. After running and exiting Firefox, running firefox --version at the same path prints Mozilla Firefox 141.0.
Is it possible that a similar auto update process is happening on LUCI?
The LUCI recipe that is failing runs multiple Firefox-based test suites, and a suite that runs later in the recipe sometimes fails.
I'm wondering if the failure may happen if Firefox updated itself while running one of the earlier suites? We could try having the test script run firefox --version to confirm that it's getting the expected version.
That's a plausible theory, I'll try to confirm if that's the case, and I'll look for a way to prevent auto updates in Firefox (Chrome doesn't have this issue because we use Chrome For Testing which has auto updates disabled by default).
Confirmed that Firefox auto updates are happening when running Web engine tests in my local environment.
I extracted the Firefox CIPD package and ran a test suite with:
FIREFOX_EXECUTABLE=$CIPD_PACKAGE_PATH/firefox dev/felt test --suite=firefox-dart2js-canvaskit-engine
After a few runs the Firefox installation at CIPD_PACKAGE_PATH was replaced by a newer version.
I was able to prevent this by adding a distribution/policies.json file to the CIPD package containing:
{
"policies": {
"DisableAppUpdate": true
}
}
(This only works if there is no system-level policy in a place like /etc/firefox/policies that overrides the distribution-level policy. I don't know if there is any such policy in the system image used on LUCI.)
Yep, I found 2 ways to disable auto-updates. The one you mentioned, and another one that works better for our current setup using prefs.js. Sending a PR soon to try it out.
After we fix the auto-update issue, we need to delete the updated Firefox executables from those bots. Does the recipe always re-download the CIPD package or does it reuse the downloaded one?
IIUC the cipd ensure command run by the Firefox dependency step will verify that the files in the destination directory match the contents of the specified package.
What happens is we download Firefox from CIPD, then we run multiple suites with the same executable. The first suite runs with the correct version 132.0. But at some point, Firefox updates itself, so a later suite runs with version 141.0.
^ This was the confusing part for me because I thought it was not possible for Firefox to update itself in the middle of a test suite. Now it all makes sense, we are running multiple suites with the same executable. We close and re-launch Firefox between suites, so the later suites will get the updated version.
I'm now trying to confirm that this works: #172775
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
Bringup `linux_web_engine_tests`; failing 4+ times in a row
matanlurey commentedon Jul 24, 2025
The test implies its something for testing Safari and Chrome but is running on Firefox? Not clear.
Bringup `linux_web_engine_tests`; failing 4+ times in a row (#172714)
jason-simmons commentedon Jul 24, 2025
This test contains a workaround for some unexpected behavior in Firefox:
https://github.com/flutter/flutter/blob/master/engine/src/flutter/lib/web_ui/test/engine/text_editing_test.dart#L692
I can reproduce the error using the current tip-of-tree on my Linux setup (running Firefox 128.12.0esr)
The test works if I replace the
expect(domDocument.activeElement, flutterView.dom.rootElement)check with theexpect(domDocument.activeElement, textEditing.strategy.domElement)used for Chromium.Possibly Firefox has fixed the issue in recent versions? The version of Firefox may not be consistent across all of the LUCI bots, so the test may need to support both behaviors.
@yjbanov
jason-simmons commentedon Jul 24, 2025
Actually the LUCI recipe is trying to ensure consistency by installing a Firefox CIPD package and using that to run the test suite.
It's installing Firefox from https://chrome-infra-packages.appspot.com/p/flutter_internal/browsers/firefox/linux-amd64/+/ajAxjAuJqj60NQuTvLhM2v1cYPK9-Ix4pbFOFHMqNoIC
Interestingly that package is labeled as
version:132.0on CIPD. But when I run the Firefox binary in the package it identifies itself as version 141.0.If I set
FIREFOX_EXECUTABLEto the binary from CIPD, then the test script launches that version of Firefox as expected. But on my setup I'm still seeing the test pass only when using the Chromium-styleexpect(domDocument.activeElement, textEditing.strategy.domElement)assertion.mdebbar commentedon Jul 25, 2025
I didn't try the linux one, but I tried the macOS: https://chrome-infra-packages.appspot.com/p/flutter_internal/browsers/firefox/mac-arm64/+/msObCvBoFYmpRGiA5RhOfoD9XjwOo8-5C3QLSdUIN6AC
It was reporting version 132.0 as expected.
Are you sure you don't have an existing Firefox installation that's v141.0? When I launched the firefox binary from CIPD, it showed me a dialog asking me if I want to switch to the already installed newer version:
jason-simmons commentedon Jul 25, 2025
Tried this again on my Linux setup, and it looks like Firefox updated itself.
When I download the CIPD package that is labeled as
version:132.0, runningfirefox --versionon the binary in the package printsMozilla Firefox 132.0.But running that Firefox for the first time starts an auto update that replaces the binaries extracted from CIPD. After running and exiting Firefox, running
firefox --versionat the same path printsMozilla Firefox 141.0.Is it possible that a similar auto update process is happening on LUCI?
The LUCI recipe that is failing runs multiple Firefox-based test suites, and a suite that runs later in the recipe sometimes fails.
I'm wondering if the failure may happen if Firefox updated itself while running one of the earlier suites? We could try having the test script run
firefox --versionto confirm that it's getting the expected version.mdebbar commentedon Jul 25, 2025
That's a plausible theory, I'll try to confirm if that's the case, and I'll look for a way to prevent auto updates in Firefox (Chrome doesn't have this issue because we use
Chrome For Testingwhich has auto updates disabled by default).jason-simmons commentedon Jul 25, 2025
Confirmed that Firefox auto updates are happening when running Web engine tests in my local environment.
I extracted the Firefox CIPD package and ran a test suite with:
After a few runs the Firefox installation at
CIPD_PACKAGE_PATHwas replaced by a newer version.I was able to prevent this by adding a
distribution/policies.jsonfile to the CIPD package containing:(This only works if there is no system-level policy in a place like
/etc/firefox/policiesthat overrides the distribution-level policy. I don't know if there is any such policy in the system image used on LUCI.)mdebbar commentedon Jul 25, 2025
Yep, I found 2 ways to disable auto-updates. The one you mentioned, and another one that works better for our current setup using
prefs.js. Sending a PR soon to try it out.After we fix the auto-update issue, we need to delete the updated Firefox executables from those bots. Does the recipe always re-download the CIPD package or does it reuse the downloaded one?
2 remaining items
jason-simmons commentedon Jul 25, 2025
IIUC the
cipd ensurecommand run by theFirefox dependencystep will verify that the files in the destination directory match the contents of the specified package.mdebbar commentedon Jul 25, 2025
I added logging for the firefox version. See: https://ci.chromium.org/ui/p/flutter/builders/try/Linux%20Engine%20Drone/3480076/overview
What happens is we download Firefox from CIPD, then we run multiple suites with the same executable. The first suite runs with the correct version 132.0. But at some point, Firefox updates itself, so a later suite runs with version 141.0.
^ This was the confusing part for me because I thought it was not possible for Firefox to update itself in the middle of a test suite. Now it all makes sense, we are running multiple suites with the same executable. We close and re-launch Firefox between suites, so the later suites will get the updated version.
I'm now trying to confirm that this works: #172775
Bringup `linux_web_engine_tests`; failing 4+ times in a row (flutter#…
[web] Text editing test accepts both behaviors in Firefox (#172767)
[web] Text editing test accepts both behaviors in Firefox (flutter#17…
mdebbar commentedon Jul 31, 2025
Update:
I tried 3 different ways to disable auto-updates:
app.update.*preferences inprefs.jsoruser.js: Causes tests to hang and eventually time outpolicies.jsonfile: Did not have any effect.To unblock releases, I landed a PR that makes the test accept both the old and new Firefox behaviors: #172767
[CP-beta][web] Text editing test accepts both behaviors in Firefox (#…
github-actions commentedon Aug 14, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[web] Text editing test accepts both behaviors in Firefox (flutter#17…
[web] Text editing test accepts both behaviors in Firefox (flutter#17…
[web] Text editing test accepts both behaviors in Firefox (flutter#17…
[web] Text editing test accepts both behaviors in Firefox (flutter#17…
[web] Text editing test accepts both behaviors in Firefox (#172767)