wpt no longer supports this, so the test resolver doesn't work.
Since mozbuild always used Py 3 this doesn't seem to be a problem
Differential Revision: https://phabricator.services.mozilla.com/D106765
Catch and report any exceptions raised in mozprocess callbacks. This allows the
ProcessReader thread to continue and mozprocess to function normally following
an exception raised in client code.
Differential Revision: https://phabricator.services.mozilla.com/D106536
This change add the ability to yield the output as it is produced, by
creating a thread responsible for killing the process if it takes too
long.
This way we can loop with blocking I/O on stdout in python, while the
process is running concurrently. The loop ends when the process exit
either by itself or after being killed by the timeout.
Differential Revision: https://phabricator.services.mozilla.com/D105037
The python subprocess module keeps getting better, while mozprocess is poorly
maintained and subject to various problems (like this bug!), so this patch
adds a comment to mozprocess warning about shortcomings.
Differential Revision: https://phabricator.services.mozilla.com/D106198
In `verify_android_device`, when `debugger` is true, we setup `lldb-server`. We
also add a new method, `run_lldb_server`, for actually starting `lldb-server`.
Both cases call into a new function, `_setup_or_run_lldb_server`.
For setup functionality, this function copies `lldb-server` to the device and
then sets up its perms within the target app's data directory.
For run functionality, this function sets some environment variables and
(re)creates directories and log files as needed. Finally it starts the server
and returns to the caller the absolute path to the socket file on the device.
The client provides that path to `lldb` in order to connect to the server.
Both cases use `ADBDevice.batch_execute` to run several commands. The
`LLDB_SERVER_INSTALL_COMMANDS_SCRIPT` and `LLDB_SERVER_START_COMMAND_SCRIPT`
commands are intended to produce the same result as the `start_lldb_server.sh`
script that is provided by Android SDK.
Differential Revision: https://phabricator.services.mozilla.com/D94383
- We make `pidof` public and we change it to guarantee that its resulting list
of pids consists of integers.
- We update `forward` and its dependencies to return the value of the port
that was assigned by `adb` so that clients may learn which port to use when
forwarding from `'tcp:0'`
Differential Revision: https://phabricator.services.mozilla.com/D94381
remoteautomation.py is an old collection of code used by android mochitest and android reftest;
it survived the removal of automation.py. This patch removes remoteautomation.py, moving the
majority of the functionality to a new class in mozdevice. Some features are simplified or
removed, and the remainder moved into the remote mochitest/reftest harnesses.
Differential Revision: https://phabricator.services.mozilla.com/D102239
This patch rewrites some parts of the GeckoProfiler code to make it clearer and easier to maintain. It also changes how the profiles get organized into separate folders for each type. Furthermore, the archives no longer have the full directory path in them. To do this, we also have to update browsertime.
Differential Revision: https://phabricator.services.mozilla.com/D102043
Add ACCESS_WIFI_STATE to the gve manifest, same as androidTest.
Remove ACCESS_WIFI_STATE from the list of pm grants, since it is not of
type dangerous.
Differential Revision: https://phabricator.services.mozilla.com/D100727
* temporarily turn off verbose during get_top_activity to prevent spamming logs.
* Update version_codes with R/30.
* Do not attempt to use su or run-as with builtin commands.
* Do not clean the test root during ADBDeviceFactory initialization
if test_root was not specified.
* Make ADBDevice.package_dir a read-only property determined
solely by the value of the internal ADBDevice._run_as_package
property.
* Use new internal method ADBDevice._try_test_root_candidates to
centralize checking if one of a list of test root candidates can be
used.
* Use new method ADBDevice.is_package_debuggable to check if
a package is debuggable and cache the result.
* run_as_package setter changes:
When setting the ADBDevice.run_as_package property to None, make
sure both the old and new values of the test root are cleaned.
If the package is not debuggable, attempt to use one of
/storage/emulated/0/Android/data/<app_name>/test_root,
/sdcard/test_root or /mnt/sdcard/test_root regardless of whether
secure storage is in effect for the version of Android. If neither
is permitted, this will result in an ADBError which will be easily
diagnosable.
* test_root getter
When first attempting to access ADBDevice.test_root, attempt to use
/data/local/tmp/test_root as the test root. If the device is not
rooted, also include /sdcard/test_root, /storage/sdcard/test_root
and /mnt/sdcard/test_root in the set of paths to check.
* test_root setter
Cache the detected test root in _initial_test_root so it can be
restored without re-running _try_test_root.
Differential Revision: https://phabricator.services.mozilla.com/D100392
The change in behaviour of the gc in Python 3 means that __del__ is
being called in cases where it previously wasn't, and this can have
unfortunate side effects where __del__ is being used to clean up
resources.
In particular with web-platform-tests running on Android, we end up
closing the test application unexpectedly. That causes widespread test
failures.
In general using __del__ for this kind of cleanup is problematic
because it's not defined exactly when, or if, it's called. It's much
better to require explcit cleanup (and better still to make that
scope-based, using a context manager, although this patch doesn't do
so).
Therefore we add an option to only do explicit cleanup. This is
currently opt-in to make the breakage as small as possible, but
ultimately ought to be the default and only behaviour. We also change
the wpt android runner to use this behaviour.
Differential Revision: https://phabricator.services.mozilla.com/D99256
This makes Linux match Windows and macOS, and avoids a py3-only bug
where mozrunner desctructors can end up being called incorrectly in
the child process, so causing tests to fail.
To do this correctly turns out to require using an explicit context
which we pass down to everywhere we use multiprocessing. That's
because wptrunner isn't usually invoked directly but from a frontend
like `wpt run` or `mach`. Therefore spawned processed don't go through
the same entrypoint as the initial process and so don't set the
context themselves.
This unfortunately requires backwards-incompatible changes in mozlog,
so that will need to be released for this to land upstream.
Differential Revision: https://phabricator.services.mozilla.com/D99247