Closed Bug 1585013 Opened 5 years ago Closed 4 years ago

Add gecko profiling support to raptor-browsertime (desktop)

Categories

(Testing :: Raptor, enhancement, P1)

Version 3
enhancement

Tracking

(firefox73 fixed)

RESOLVED FIXED
mozilla73
Tracking Status
firefox73 --- fixed

People

(Reporter: rwood, Assigned: tarek)

References

(Blocks 3 open bugs)

Details

Attachments

(1 file)

Add the ability to generate gecko profiles while running raptor-browsertime tests. Start with page-load tests on desktop.

Blocks: 1585010

This will depend on https://github.com/mozilla/browsertime/issues/42, at least for warmload.

Blocks: 1582756

I have significant work in progress on this, but it's not quite all together yet. It's best to do this after merging upstream into mozilla/browsertime, which is a big lift (but done locally); and then I ran into some issues testing. Specifically, I'm not quite able to verify that we stitch visual metrics into profiles correctly after my changes, mostly 'cuz it took some time to discover the Gecko profiler needs an x86_64 build (and not an i686 build, see Bug 1580999) and then not yet being able to use the Gecko window recorder under the x86_64 emulator (see Bug 1584659).

I'll pick this up next week.

Assignee: nobody → nalexander
Status: NEW → ASSIGNED
Priority: P2 → P1
Blocks: 1581560

the current patch adds the '--firefox.geckoProfiler' to the command line.

Browsertime fails with:

[task 2019-10-30T14:59:10.785Z] 14:59:10     INFO -  [2019-10-30 14:59:10] VERBOSE: [browsertime] Executing privileged async script Collect GeckoProfiler
[task 2019-10-30T14:59:10.819Z] 14:59:10     INFO -  /Users/cltbld/tasks/task_1572447399/fetches/browsertime/node_modules/browsertime/node_modules/selenium-webdriver/lib/promise.js:2626
[task 2019-10-30T14:59:10.819Z] 14:59:10     INFO -          throw error;
[task 2019-10-30T14:59:10.819Z] 14:59:10     INFO -          ^
[task 2019-10-30T14:59:10.819Z] 14:59:10     INFO -  JavascriptError: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIProfiler.dumpProfileToFileAsync]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: [System Principal] :: <TOP_LEVEL> :: line 4"  data: no]
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at Object.throwDecodedError (/Users/cltbld/tasks/task_1572447399/fetches/browsertime/node_modules/browsertime/node_modules/selenium-webdriver/lib/error.js:514:15)
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at parseHttpResponse (/Users/cltbld/tasks/task_1572447399/fetches/browsertime/node_modules/browsertime/node_modules/selenium-webdriver/lib/http.js:519:13)
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at doSend.then.response (/Users/cltbld/tasks/task_1572447399/fetches/browsertime/node_modules/browsertime/node_modules/selenium-webdriver/lib/http.js:441:30)
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at <anonymous>
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at process._tickCallback (internal/process/next_tick.js:188:7)
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -  From: Task: WebDriver.executeScript()
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at Driver.schedule (/Users/cltbld/tasks/task_1572447399/fetches/browsertime/node_modules/browsertime/node_modules/selenium-webdriver/lib/webdriver.js:807:17)
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at Driver.executeAsyncScript (/Users/cltbld/tasks/task_1572447399/fetches/browsertime/node_modules/browsertime/node_modules/selenium-webdriver/lib/webdriver.js:891:17)
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at SeleniumRunner.runPrivilegedAsyncScript (/Users/cltbld/tasks/task_1572447399/fetches/browsertime/node_modules/browsertime/lib/core/seleniumRunner.js:386:30)
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at <anonymous>
[task 2019-10-30T14:59:10.820Z] 14:59:10     INFO -      at process._tickCallback (internal/process/next_tick.js:188:7)
[task 2019-10-30T15:01:11.088Z] 15:01:11    ERROR -  Traceback (most recent call last):
[task 2019-10-30T15:01:11.088Z] 15:01:11     INFO -    File "/Users/cltbld/tasks/task_1572447399/build/tests/raptor/raptor/raptor.py", line 1532, in <module>
[task 2019-10-30T15:01:11.088Z] 15:01:11     INFO -      main()
[task 2019-10-30T15:01:11.088Z] 15:01:11     INFO -    File "/Users/cltbld/tasks/task_1572447399/build/tests/raptor/raptor/raptor.py", line 1500, in main
[task 2019-10-30T15:01:11.088Z] 15:01:11     INFO -      success = raptor.run_tests(raptor_test_list, raptor_test_names)
[task 2019-10-30T15:01:11.088Z] 15:01:11     INFO -    File "/Users/cltbld/tasks/task_1572447399/build/tests/raptor/raptor/raptor.py", line 213, in run_tests
[task 2019-10-30T15:01:11.089Z] 15:01:11     INFO -      self.run_test_teardown(test)
[task 2019-10-30T15:01:11.089Z] 15:01:11     INFO -    File "/Users/cltbld/tasks/task_1572447399/build/tests/raptor/raptor/raptor.py", line 406, in run_test_teardown
[task 2019-10-30T15:01:11.089Z] 15:01:11     INFO -      super(Browsertime, self).run_test_teardown(test)
[task 2019-10-30T15:01:11.089Z] 15:01:11     INFO -    File "/Users/cltbld/tasks/task_1572447399/build/tests/raptor/raptor/raptor.py", line 228, in run_test_teardown
[task 2019-10-30T15:01:11.089Z] 15:01:11     INFO -      self.gecko_profiler.symbolicate()
[task 2019-10-30T15:01:11.089Z] 15:01:11     INFO -  AttributeError: 'NoneType' object has no attribute 'symbolicate'
[task 2019-10-30T15:01:11.243Z] 15:01:11    ERROR - Return code: 1
[task 2019-10-30T15:01:11.243Z] 15:01:11  WARNING - setting return code to 1
[task 2019-10-30T15:01:11.243Z] 15:01:11     INFO - Copying Raptor results to upload dir:
[task 2019-10-30T15:01:11.243Z] 15:01:11     INFO - /Users/cltbld/tasks/task_1572447399/build/blobber_upload_dir/perfherder-data.json

:rwood maybe we can get someone to take a look over the browsertime error

Flags: needinfo?(rwood)

Bebe, if it's helpful, it looks like raptor's self.gecko_profiler is null here.
You can verify what's happening in the initialization:
https://searchfox.org/mozilla-central/rev/3300072e993ae05d50d5c63d815260367eaf9179/testing/raptor/raptor/raptor.py#725-733

Maybe MOZ_UPLOAD_DIR not set?

I have fixed the python error.

The js issue is also "captured" in https://github.com/mozilla/browsertime/issues/42

Flags: needinfo?(rwood)
Priority: P1 → P2

Hey :bebe what is the status of this (did you say there is still an error when running gecko profiling via raptor --browsertime)? Thanks!

Flags: needinfo?(fstrugariu)

:rwood see Comment 9
We are blocked on the Browsertime JS part

Flags: needinfo?(fstrugariu)
Summary: Add gecko profiling support to raptor-browsertime → Add gecko profiling support to raptor-browsertime (desktop)
Blocks: 1601011
Assignee: nalexander → tarek

also, looks like the responsiveness feature is not recognized

[2019-12-05 10:06:56] DEBUG: [browsertime] Waiting after load event for 5000 ms.
[2019-12-05 10:07:01] INFO: [browsertime] Waiting for 30000 ms (post_startup_delay)
[2019-12-05 10:07:31] INFO: [browsertime] Cycle 0, waiting for 1000 ms
[2019-12-05 10:07:32] INFO: [browsertime] Cycle 0, starting the measure
[2019-12-05 10:07:32] INFO: [browsertime.command.measure] Testing url https://www.google.com/search?hl=en&q=barack+obama&cad=h iteration 1
[2019-12-05 10:07:32] VERBOSE: [browsertime] Executing privileged script Get StartProfiler.length
[2019-12-05 10:07:32] INFO: [browsertime.firefox] Start GeckoProfiler.
[2019-12-05 10:07:32] VERBOSE: [browsertime] Executing privileged script Start GeckoProfiler

Unrecognized feature "responsiveness".

I was able to make it work on warm load tests pending this patch: https://github.com/mozilla/browsertime/pull/50

Nick's issue on browsertime is a bit cryptic to me. But it looks like an improvement we can do later.

Depends on: 1601646
Priority: P2 → P1
Blocks: 1602577
No longer blocks: 1602577
Depends on: 1602577
Blocks: 1603108
Blocks: 1603152
Pushed by tziade@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/12c1e0fcd544
Add gecko profiling support to raptor-browsertime r=rwood,perftest-reviewers
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: