Closed Bug 1773337 Opened 2 years ago Closed 2 years ago

Running `mach wpt --product chrome path/to/test` doesn't work

Categories

(Testing :: web-platform-tests, defect, P1)

Default
defect

Tracking

(firefox104 fixed)

RESOLVED FIXED
104 Branch
Tracking Status
firefox104 --- fixed

People

(Reporter: padenot, Assigned: jgraham)

References

Details

Attachments

(1 file)

I'm running this on an Apple Silicon mac, this is what I get:

trees/mozilla-unified::phab-D148524_1$ mach wpt --product chrome testing/web-platform/tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-suspend-resume-close.html
 0:00.00 INFO Skipping manifest download because existing file is recent
Error running mach:

    ['wpt', '--product', 'chrome', 'testing/web-platform/tests/webaudio/the-audio-api/the-audiocontext-interface/audiocontext-suspend-resume-close.html']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file wpt| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

FileNotFoundError: [Errno 2] No such file or directory: '/Users/padenot/src/trees/mozilla-unified/obj-aarch64-apple-darwin21.4.0/_virtualenvs/common/bin/python'

  File "/Users/padenot/src/trees/mozilla-unified/testing/web-platform/mach_commands.py", line 531, in run_wpt
    return run_web_platform_tests(command_context, **params)
  File "/Users/padenot/src/trees/mozilla-unified/testing/web-platform/mach_commands.py", line 520, in run_web_platform_tests
    return wpt_runner.run(logger, **params)
  File "/Users/padenot/src/trees/mozilla-unified/testing/web-platform/mach_commands_base.py", line 57, in run
    kwargs = self.setup.kwargs_wptrun(kwargs)
  File "/Users/padenot/src/trees/mozilla-unified/testing/web-platform/mach_commands.py", line 188, in kwargs_wptrun
    self.virtualenv_manager.install_pip_requirements(
  File "/Users/padenot/src/trees/mozilla-unified/python/mach/mach/site.py", line 638, in install_pip_requirements
    install_result = self._virtualenv.pip_install(
  File "/Users/padenot/src/trees/mozilla-unified/python/mach/mach/site.py", line 847, in pip_install
    return subprocess.run(
  File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/Users/padenot/src/trees/mozilla-unified/third_party/python/sentry_sdk/sentry_sdk/integrations/stdlib.py", line 190, in sentry_patched_popen_init
    rv = old_popen_init(self, *a, **kw)  # type: ignore
  File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/opt/homebrew/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Sentry event ID: 329fb1a6a2a94e88b52332a51c799721

Running a similar command on linux also gives me similar errors

❯ ./mach wpt --product chrome --binary /usr/bin/chromium testing/web-platform/tests/largest-contentful-paint
 0:00.00 INFO Skipping manifest download because existing file is recent
Error running mach:

    ['wpt', '--product', 'chrome', '--binary', '/usr/bin/chromium', 'testing/web-platform/tests/largest-contentful-paint']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file wpt| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

FileNotFoundError: [Errno 2] No such file or directory: '/home/sefeng/.local/workspace/mozilla/mozilla-unified3/.build-obj/release/_virtualenvs/common/bin/python'

  File "/home/sefeng/.local/workspace/mozilla/mozilla-unified3/testing/web-platform/mach_commands.py", line 531, in run_wpt
    return run_web_platform_tests(command_context, **params)
  File "/home/sefeng/.local/workspace/mozilla/mozilla-unified3/testing/web-platform/mach_commands.py", line 520, in run_web_platform_tests
    return wpt_runner.run(logger, **params)
  File "/home/sefeng/.local/workspace/mozilla/mozilla-unified3/testing/web-platform/mach_commands_base.py", line 57, in run
    kwargs = self.setup.kwargs_wptrun(kwargs)
  File "/home/sefeng/.local/workspace/mozilla/mozilla-unified3/testing/web-platform/mach_commands.py", line 188, in kwargs_wptrun
    self.virtualenv_manager.install_pip_requirements(
  File "/home/sefeng/.local/workspace/mozilla/mozilla-unified3/python/mach/mach/site.py", line 638, in install_pip_requirements
    install_result = self._virtualenv.pip_install(
  File "/home/sefeng/.local/workspace/mozilla/mozilla-unified3/python/mach/mach/site.py", line 846, in pip_install
    return subprocess.run(
  File "/usr/lib/python3.10/subprocess.py", line 501, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/home/sefeng/.local/workspace/mozilla/mozilla-unified3/third_party/python/sentry_sdk/sentry_sdk/integrations/stdlib.py", line 190, in sentry_patched_popen_init
    rv = old_popen_init(self, *a, **kw)  # type: ignore
  File "/usr/lib/python3.10/subprocess.py", line 969, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.10/subprocess.py", line 1845, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

Sentry event ID: a6bf5c80c8f343e48474725a9e221916

We need to access the virtualenv to install dependencies when running
with other browsers, but _spawn doesn't correctly pass this down into
the created MozbuildObject.

For now just work around the problem by setting the property on the
created object.

Assignee: nobody → james
Status: NEW → ASSIGNED

The severity field is not set for this bug.
:jgraham, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(james)
Severity: -- → S3
Flags: needinfo?(james)
Priority: -- → P1
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/autoland/rev/e7c1d97b7f83 = Set virtualenv for MozbuildObject when running mach wpt, r=jmaher
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

I am still getting the same error with today's m-c (Confirmed the patch is in there).

I'm getting a different error (which is apparently because I don't have /usr/bin/chromium, which I'm not sure why I need to run Chrome, but must be an upstream change). However the virtualenv stuff works. Can you verify that wptsetup._virtualenv_name is "wpt" in the line right after the patch but that the virtualenv_manager.virtualenv_root is set to something ending /common at https://searchfox.org/mozilla-central/source/testing/web-platform/mach_commands.py#192-194 ?

For me I got this

VirtualEnv Name: common
VirtualEnv Manager /home/sefeng/.local/workspace/mozilla/mozilla-unified3/.build-obj/release/_virtualenvs/common
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: