Closed Bug 1560193 Opened 1 year ago Closed 1 year ago

mach browsertime visual metrics fail with node installed globally


(Firefox Build System :: General, defect)

Not set


(firefox-esr60 unaffected, firefox-esr68 wontfix, firefox68 wontfix, firefox69 fixed)

Tracking Status
firefox-esr60 --- unaffected
firefox-esr68 --- wontfix
firefox68 --- wontfix
firefox69 --- fixed


(Reporter: barret, Assigned: barret)




(Keywords: regression)


(1 file)

Attempting to run ./mach browsertime with a global installation of node will fail:

0:00.40 /usr/bin/nodejs /home/barret/Workspace/src/ --skipHar --visualMetrics -b firefox --firefox.binaryPath /home/barret/.local/opt/firefox-nightly/firefox --video
[2019-06-18 15:38:37] INFO: Running tests using Firefox - 3 iteration(s)
[2019-06-18 15:38:38] INFO: Testing url iteration 1
[2019-06-18 15:38:49] ERROR: Visual Metrics failed to analyse the video Error: Command failed: python /home/barret/Workspace/src/ --dir /home/barret/Workspace/src/ --video /home/barret/Workspace/src/ --orange --perceptual --contentful --force --renderignore 5 --json --viewport -q 75

    at makeError (/home/barret/Workspace/src/
    at /home/barret/Workspace/src/
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
[2019-06-18 15:38:49] INFO: BackEndTime: 358 DomInteractiveTime: 1237 DomContentLoadedTime: 1237 FirstPaint: 433 PageLoadTime: 3757

As it turns out, the global installation of python ends up being used instead of the python in the virtual environment generated in the mozilla-central checkout. This happens because to execa, the library that browsertime uses to execute processes, prepends the directory that node is in to your PATHenvironment variable, which when node is installed globally, is /usr/bin. Thus /usr/bin/python will be executed to run browsertime's instead of the virtualenv wrapped python which will fail if you do not have all the python dependencies installed globally.

We already have support in our fork of browsertime for specifying which python to use (via the PYTHON environment variable), so we can manually set this to the path of the python executable in the virtualenv.

If ./mach browsertime runs browsertime with a globally-installed node, due to
an existing bug in execa, the wrong Python will be executed. We now
specify the full path of the Python binary we wish to use (via the PYTHON
environment variable that our fork of browsertime supports) and avoid this
issue altogether.

Pushed by
Always specify the Python executable to use when running `./mach browsertime` r=nalexander
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
No longer regressions: 1565030
You need to log in before you can comment on or make changes to this bug.