Closed Bug 1493252 Opened 11 months ago Closed 11 months ago

Automatic profile viewing after mach talos-test doesn't work on my macOS machine

Categories

(Testing :: Talos, defect)

All
macOS
defect
Not set

Tracking

(firefox64 fixed)

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: mstange, Assigned: Bebe)

References

Details

Attachments

(1 file)

> $ ./mach talos-test tp5o --geckoProfile
> [...]
> 14:40:57     INFO -  Thanks for running Talos locally. Results are in ['/Users/mstange/code/mozilla/testing/mozharness/build/local.json']
> 14:40:57     INFO -  Auto-loading this profile in perfhtml.io: /Users/mstange/code/mozilla/testing/mozharness/build/blobber_upload_dir/profile_tp5o.zip
> 14:40:57     INFO -  ['python', '/Users/mstange/code/mozilla/testing/tools/view_gecko_profile/view_gecko_profile.py', '-b', '/Users/mstange/code/obj-m-opt/dist/Nightly.app/Contents/MacOS/firefox', '-p', '/Users/mstange/code/mozilla/testing/mozharness/build/blobber_upload_dir/profile_tp5o.zip']
> 14:41:02     INFO -  view-gecko-profile process failed to start, poll returned: 1
> 14:41:03     INFO - Return code: 0
> [...]

> $ python /Users/mstange/code/mozilla/testing/tools/view_gecko_profile/view_gecko_profile.py -b /Users/mstange/code/obj-m-opt/dist/Nightly.app/Contents/MacOS/firefox -p /Users/mstange/code/mozilla/testing/mozharness/build/blobber_upload_dir/profile_tp5o.zip
> Traceback (most recent call last):
>   File "/Users/mstange/code/mozilla/testing/tools/view_gecko_profile/view_gecko_profile.py", line 22, in <module>
>     from wptserve import server, handlers
> ImportError: No module named wptserve
I see the same thing on my local OSX when running talos with --geckoProfile. Interesting though, if I follow the steps in the view_gecko_profile readme [1] and then run it directly [2], it works - Firefox starts and displays the profile in perf-html.io. Not sure why it's not working via talos... need to take a closer look.

[1] https://searchfox.org/mozilla-central/source/testing/tools/view_gecko_profile/README.txt

[2] (venv) Roberts-MacBook-Pro-1927:view_gecko_profile rwood$ python view_gecko_profile.py -b "/Users/rwood/mozilla-unified/obj-x86_64-apple-darwin17.7.0/dist/NightlyDebug.app/Contents/MacOS/firefox" -p "/Users/rwood/mozilla-unified/testing/mozharness/build/blobber_upload_dir/profile_damp.zip"
Duplicate of this bug: 1496631
I am pretty swamped and haven't had time to fix this - :igoldan can you please take this maybe? The view_gecko_profile tool itself is working fine when running it directly (see the README above in Comment 1). However Talos is failing to launch it now for some reason.
Flags: needinfo?(igoldan)
:igoldan is out today (I forgot), :bebe if you can take this that'd be great, thank you! :)
Flags: needinfo?(igoldan) → needinfo?(bebe)
I investigated this and it looks like we don't install the 'view_gecko_profile' dependencies when creating the virtualEnv to run the tests.

To fix this we have multiple solutions:
1. Add missing dependency in talos  requirements.txt file
2. When running the 'view_gecko_profile' method from run_tests.py execute pip install  -r 'tools/view_gecko_profile/requirements.txt' before executing view_gecko_profile.py
3. add view_gecko_profile requierments in the mach enviorment install. <not sure how to do that>

Can you suggest the best solution please?
Flags: needinfo?(rwood)
Flags: needinfo?(jmaher)
Flags: needinfo?(bebe)
If the requirements change, option 1 is not ideal.  I like option 3, but that might be hard.  Maybe :ahal would have ideas on how to install other tools requirements when running a mach command?
Flags: needinfo?(rwood)
Flags: needinfo?(jmaher)
Flags: needinfo?(ahal)
(In reply to Florin Strugariu [:Bebe] from comment #5)
> I investigated this and it looks like we don't install the
> 'view_gecko_profile' dependencies when creating the virtualEnv to run the
> tests.
> 
> To fix this we have multiple solutions:
> 1. Add missing dependency in talos requirements.txt file
> 2. When running the 'view_gecko_profile' method from run_tests.py execute
> pip install -r 'tools/view_gecko_profile/requirements.txt' before executing
> view_gecko_profile.py
> 3. add view_gecko_profile requierments in the mach enviorment install. <not
> sure how to do that>
> 
> Can you suggest the best solution please?

Out of those options, I'd say the 2nd one is desirable.
Funny thing is we already have that check implemented here [1], for this very precise reason. However, we don't reach those lines because of [2].
I'm guessing that when the reporter ran |mach talos-test| for the first time, he didn't provide the --geckoProfile flag.
Mozharness created the virtualenv with some dependencies, but not those for view_gecko_profile module.

If we move the whole block from lines 635 to 643 before [2], it would solve our issue.

[1] https://searchfox.org/mozilla-central/source/testing/mozharness/mozharness/mozilla/testing/talos.py#637
[2] https://searchfox.org/mozilla-central/source/testing/mozharness/mozharness/mozilla/testing/talos.py#593
Attached patch 439743.patchSplinter Review
I did something similar with what :igoldan suggested.

Aso fixed a issue with the path to the binary
Assignee: nobody → bebe
Attachment #9015258 - Flags: review?(rwood)
Attachment #9015258 - Flags: review?(jmaher)
Attachment #9015258 - Flags: feedback?(igoldan)
Comment on attachment 9015258 [details] [diff] [review]
439743.patch

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

Have you pushed this to try?  I want to make sure this works and we can run our existing jobs as well as profiled jobs on try.
Attachment #9015258 - Flags: review?(rwood)
Flags: needinfo?(ahal)
Comment on attachment 9015258 [details] [diff] [review]
439743.patch

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

this is really simple and things look good while run on try pushes.  If igoldan has any feedback, we can adjust as needed, otherwise we can land.
Attachment #9015258 - Flags: review?(jmaher) → review+
(In reply to Joel Maher ( :jmaher ) (UTC-4) from comment #10)
> If igoldan has any feedback, we can adjust as needed, otherwise we can land.

Nothing more to add. The code looks good :)
Attachment #9015258 - Flags: feedback?(igoldan) → feedback+
Pushed by cbrindusan@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/afc8d7a964b4
Automatic profile viewing after mach talos-test doesn't work on my macOS machine. r=jmaher
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/afc8d7a964b4
Status: NEW → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.