Closed Bug 1983007 Opened 1 year ago Closed 8 months ago

Remove baseline profile generators for the old toolbar, after the new toolbar has fully replaced it

Categories

(Firefox for Android :: Performance, defect)

All
Android
defect

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: titouan, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: intermittent-failure)

We have some flakiness and a few failures happening on the PrivateBrowsingBaselineProfileGenerator, specifically with the Compose Toolbar enabled.
Here is an example of a job that failed. The logs on Firebase TestLab are here.

androidx.test.uiautomator.UiObjectNotFoundException: UiSelector[RESOURCE_ID=org.mozilla.fenix:id/mozac_addressbar_search_query_input]

It looks like uiautomator cannot find the element, and gets stuck like we can see on the video here (start the video on 4:20)

Could not reproduce locally (in manual testing the app or by running the same test locally)
But could reproduce it in TH.
Got 4 flaky & 1 failure in 150 runs.
Think I saw the issue: a race in lib-state between starting search (through appStore.dispatch and observing search status though apstore.flow().observe() here based on which we would exit search.

We discussed about this issue in the broader eng group recently and I think the best course of action is really to wait for Polly's work to remove the threading from lib-state, something that is already planned here here.
With the change for remove the concurrency model from lib-state planned for the next Nightly train I propose to re-check this issue after that change is merged.

Summary: PrivateBrowsingBaselineProfileGenerator is flacky → PrivateBrowsingBaselineProfileGenerator is flaky

Instance (08-19)

org.mozilla.fenix.benchmark.baselineprofile.SwitchTabsBaselineProfileGenerator#generateBaselineProfile[composableToolbar=true]

https://treeherder.mozilla.org/logviewer?job_id=522977947&repo=autoland&task=WasrMe13RnmWOK1bY-FmbQ.0&lineNumber=215

androidx.test.uiautomator.UiObjectNotFoundException: UiSelector[RESOURCE_ID=org.mozilla.fenix:id/mozac_addressbar_search_query_input]
	at androidx.test.uiautomator.UiObject.setText(UiObject.java:589)
	at org.mozilla.fenix.benchmark.utils.UiDeviceKt.loadSite(UiDevice.kt:175)
	at org.mozilla.fenix.benchmark.baselineprofile.SwitchTabsBaselineProfileGenerator.generateBaselineProfile$lambda$0(SwitchTabsBaselineProfileGenerator.kt:77)
	at org.mozilla.fenix.benchmark.baselineprofile.SwitchTabsBaselineProfileGenerator.$r8$lambda$2XWUEI2FZFNKfOSHeBTv2l4s2z4(Unknown Source:0)
	at org.mozilla.fenix.benchmark.baselineprofile.SwitchTabsBaselineProfileGenerator$$ExternalSyntheticLambda0.invoke(D8$$SyntheticClass:0)
	at androidx.benchmark.macro.BaselineProfilesKt$collect$1$1$3.invoke(BaselineProfiles.kt:94)
	at androidx.benchmark.macro.BaselineProfilesKt$collect$1$1$3.invoke(BaselineProfiles.kt:91)
	at androidx.benchmark.macro.CompilationMode$Partial.compileImpl$benchmark_macro_release(CompilationMode.kt:369)
	at androidx.benchmark.macro.BaselineProfilesKt.collect(BaselineProfiles.kt:91)
	at androidx.benchmark.macro.junit4.BaselineProfileRule.collect(BaselineProfileRule.kt:94)
	at androidx.benchmark.macro.junit4.BaselineProfileRule.collect$default(BaselineProfileRule.kt:83)
	at org.mozilla.fenix.benchmark.baselineprofile.SwitchTabsBaselineProfileGenerator.generateBaselineProfile(SwitchTabsBaselineProfileGenerator.kt:63)

SwitchTabsBaselineProfileGenerator is also flaky because it uses the same underlying function to type in the search bar as PrivateBrowsingBaselineProfileGenerator. NormalBrowsingBaselineProfileGenerator also uses the same underlying function but it seems to be less flaky as the other two

Summary: PrivateBrowsingBaselineProfileGenerator is flaky → PrivateBrowsingBaselineProfileGenerator and SwitchTabsBaselineProfileGenerator is flaky
See Also: → 1986571

Sounds like this depends on https://bugzilla.mozilla.org/show_bug.cgi?id=1980348 based on comment #1 but I'll leave it up to you.

  • PrivateBrowsingBaselineProfileGenerator#generateBaselineProfile[composableToolbar=true] ~ 60 flaky instances, ~10 failing back to back last week
  • SwitchTabsBaselineProfileGenerator#generateBaselineProfile[composableToolbar=true] ~ 27 flaky instances, ~13 failing back to back last week
Depends on: 1980348
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---

Just an update from week of Sept 29th, and these tests which are most flaky (descending)

  • privateBrowsing[composableToolbar=false] - 28 flaky instances
  • normalBrowsing[composableToolbar=false] - 15 flaky instances
  • privateBrowsingNone[composableToolbar=false] - 11 flaky instances, 1 failure
  • switchTabs[composableToolbar=false] - 9 flaky instances
  • normalBrowsingNone[composableToolbar=false] - 8 flaky instances
  • privateBrowsing[composableToolbar=true] - 6 flaky instances, 1 failure
  • switchTabs[composableToolbar=true] - 7 flaky instances

At a glance, results look better when the Compose toolbar is enabled. Maybe it's worth only testing with the toolbar on here? I'll leave that up to you Titouan.

Updating the title to encapsulate private/normal

Summary: PrivateBrowsingBaselineProfileGenerator and SwitchTabsBaselineProfileGenerator is flaky → Normal and Private BrowsingBaselineProfileGenerator and SwitchTabsBaselineProfileGenerator are flaky
Status: REOPENED → RESOLVED
Closed: 1 year ago → 1 year ago
Resolution: --- → INCOMPLETE

Update from prior week of November 10, 2025 – Baseline test flakiness summary

privateBrowsingBaselineProfile[composableToolbar=true] – 19 flaky instances, 0 failures
normalBrowsing[composableToolbar=false] – 7 flaky instances, 0 failures
privateBrowsing[composableToolbar=false] – 4 flaky instances, 0 failures

Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 1 year ago → 1 year ago
Resolution: --- → INCOMPLETE

Still quite flaky, but this may be a WONTFIX if the old toolbar is being removed and at that time remove those benchmarks

Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---

The old toolbar should be removed in a few cycles, with Bug 2015402.

Removing the baseline profile generators using this
I'll rename this bug so that it's clear that we aim to remove those composeToolbar=true jobs, which are the only ones that have a flakiness rate above 2%.

Depends on: 2015402
Summary: Normal and Private BrowsingBaselineProfileGenerator and SwitchTabsBaselineProfileGenerator are flaky → Remove baseline profile generators for the old toolbar, after the new toolbar has fully replaced it
Status: REOPENED → RESOLVED
Closed: 1 year ago → 9 months ago
Resolution: --- → INCOMPLETE

We'll keep this bug open, it will track the work to remove the baseline profile related to the old toolbar when we disable it completely.

Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 9 months ago → 8 months ago
Resolution: --- → INCOMPLETE
See Also: → 2027031
You need to log in before you can comment on or make changes to this bug.