Closed Bug 1549631 Opened 7 months ago Closed 6 months ago

Implement browser app backgrounded idle-power-use test

Categories

(Testing :: Raptor, task, P1)

Version 3
task

Tracking

(firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: stephend, Assigned: sparky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

One of the use-cases/tests from https://bugzilla.mozilla.org/show_bug.cgi?id=1511347#c1 is: "Target app running in background," with bug 1546741 and bug 1548689 addressing "Target app running in foreground."

Very early and coarse vetting seems to indicate that this might be possible/feasible, even in CI (but we need to be extra careful[0][1]) with something like the following:

Launch the (browser) app:

adb shell am start -n org.mozilla.firefox/org.mozilla.gecko.BrowserApp -a android.intent.action.VIEW -d https://www.mozilla.com

(of course, we'd do it with Raptor)

Send target app to the background/minimize:

adb shell input keyevent 3

[0] As with our other power-use measurement tests, running for 20+ minutes in CI, a piece, we don't want to introduce test/data instability, due to this feature.
[1] There are also warnings/cautions from our Android team, who note that this (app-in-background scenario) is susceptible and beholden too, Android's memory-pressure killing off backgrounded apps/processes.

See Also: → 1546741
Blocks: 1511347
Assignee: nobody → stephen.donner

A couple more notes:

  1. Looks like we might be able to use adb.py's launch_activity()[2] to issue adb shell input keyevent 3, to minimize/relegate the app to the background.
  2. However, in continuing to vet this approach, we should be very mindful of Android's memory-pressure[3] caveats -- the gist of which, verbatim, is "Android can reclaim memory from your app in several ways or kill your app entirely if necessary to free up memory for critical tasks."

I'm going to vet some more on both my G5 and my Pixel 2; so far, so good, with the 20 minutes test duration + our various browsers are the only app launched (after a clean adb reboot).

[2] https://searchfox.org/mozilla-central/rev/94c6b5f06d2464f6780a52f32e917d25ddc30d6b/testing/mozbase/mozdevice/mozdevice/adb.py#3098
[3] https://developer.android.com/topic/performance/memory#release

Priority: P2 → P1
Attachment #9067250 - Attachment description: Bug 1549631. Add new target app (browser) backgrounded, idle-power-use test. r?rwood,sparky,bc → Bug 1549631 - Add new target app (browser) backgrounded, idle-power-use test. r?rwood,sparky,bc
Summary: Vet/implement target app (browser) backgrounded, Idle-power-use test → implement browser app backgrounded idle-power-use test
Attachment #9067250 - Attachment description: Bug 1549631 - Add new target app (browser) backgrounded, idle-power-use test. r?rwood,sparky,bc → Bug 1549631 - Add new target app (browser) backgrounded, idle-power-use test. r?rwood,#perftest

Try push for the latest patch (ready for review): https://treeherder.mozilla.org/#/jobs?repo=try&tier=1%2C2%2C3&revision=175522b32fedcbcf1979ade4787c06babda6e760

Test time has been dropped to 10 minutes (due to intermittents). I've retriggered some of the tests a few extra times just in case.

Type: defect → task

I had to finalize some issues and update the patch to the latest central commit, here's a try run with the new patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=d1620ff33e33d865e861d813ec415c1b6f2cfc43

The try run for the last patch is here: https://treeherder.mozilla.org/#/jobs?repo=try&tier=1%2C2%2C3&revision=8d15a37e8db49c3653e2fa3dc0c2f9234e500568

Last patch failed on refbrow tasks because I didn't change the reference browser activity, here is one for reference browser with the modifications made: https://treeherder.mozilla.org/#/jobs?repo=try&tier=1%2C2%2C3&revision=62af2bf027079b8748a25f0cd8a7fcb6aef9ffea

Assignee: stephen.donner → gmierz2
Summary: implement browser app backgrounded idle-power-use test → Implement browser app backgrounded idle-power-use test
Pushed by gmierz2@outlook.com:
https://hg.mozilla.org/integration/autoland/rev/c532dce1d92a
Add new target app (browser) backgrounded, idle-power-use test. r=rwood,AlexandruIonescu
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.