Closed Bug 1483478 Opened 6 years ago Closed 6 years ago

Android AWSY test should store about:memory dumps as artifacts

Categories

(Testing :: General, enhancement, P2)

Version 3
enhancement

Tracking

(firefox65 fixed)

RESOLVED FIXED
mozilla65
Tracking Status
firefox65 --- fixed

People

(Reporter: glandium, Assigned: gbrown)

References

Details

Attachments

(1 file, 1 obsolete file)

On platforms that use the actual AWSY test, we get about:memory dumps for every measurement, which is extremely useful when looking at regressions.

But the android pseudo-AWSY test doesn't do the same, and that makes things harder to track down. For instance, for bug 1482797, I ended up patching the test to emit a dump like the real AWSY does, but couldn't figure out how to get that out of the emulator, so I ended up connecting to an interactive task on taskcluster, and manually adb pull the files when they appeared.
On the host, environment variable MOZ_UPLOAD_DIR provides a magic location for artifacts. So if runtestsremote.py ran 

  self.device.pull(remote_dir, os.environ['MOZ_UPLOAD_DIR'])

then any files written to remote_dir would become available as artifacts.

I'm not sure how to share remote_dir between remote test harness and test: If runtestsremote.py uses remote_dir = '/sdcard/tests/artifacts', how does test_awsy_lite.html discover that location (or vice versa)?
Priority: -- → P3
See Also: → 1508565
Assignee: nobody → gbrown
Priority: P3 → P2
In my first attempt here, I tried calling

+    var memDumper = Cc["@mozilla.org/memory-info-dumper;1"].getService(Ci.nsIMemoryInfoDumper);
+    memDumper.dumpMemoryInfoToTempDir(aLabel, /* anonymize = */ false,
+                                      /* minimize = */ false);

That generated unified-memory-report-<aLabel>-<pid>.json.gz in fennec's app_tmpdir/memory-reports - great!

BUT, the file was empty - 0 length. Hmm.
Comment on attachment 9027037 [details] [diff] [review]
save memory dumps as artifacts in test_awsy_lite

Review of attachment 9027037 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/tests/browser/chrome/test_awsy_lite.html
@@ +39,4 @@
>    SimpleTest.requestLongerTimeout(3); // several long waits and GCs make for a long-running test
>    SimpleTest.requestCompleteLog(); // so that "PERFHERDER_DATA" can be scraped from the log
>  
> +  function checkpoint(aName, aSimpleName) {

It feels like it would be better to generate the simple name from aName, by filtering for [a-zA-Z0-9 ] and then replacing " " with "-".
Attachment #9027037 - Flags: review?(mh+mozilla)
(In reply to Geoff Brown [:gbrown] from comment #1)
> On the host, environment variable MOZ_UPLOAD_DIR provides a magic location
> for artifacts. So if runtestsremote.py ran 
> 
>   self.device.pull(remote_dir, os.environ['MOZ_UPLOAD_DIR'])

That's not part of your patch, though.
(In reply to Mike Hommey [:glandium] from comment #6)
> (In reply to Geoff Brown [:gbrown] from comment #1)
> > On the host, environment variable MOZ_UPLOAD_DIR provides a magic location
> > for artifacts. So if runtestsremote.py ran 
> > 
> >   self.device.pull(remote_dir, os.environ['MOZ_UPLOAD_DIR'])
> 
> That's not part of your patch, though.

Sorry, should have explained that. The harness already pulls from self.remoteMozLog to MOZ_UPLOAD_DIR. This patch leverages that by writing the memory dumps to self.remoteMozLog.
Attachment #9027191 - Flags: review?(mh+mozilla) → review+
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/510f4bccd603
Store memory dump artifacts in awsy-lite; r=glandium
https://hg.mozilla.org/mozilla-central/rev/510f4bccd603
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: