Commit Graph
82 Commits
Author SHA1 Message Date
Sylvestre Ledru 9d4a84d778 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG
2017-07-06 14:00:35 +02:00
Andrew Halberstadt bce781d9b8 Bug 1373294 - Fix E305 (two blank lines after method or class) in files enabled by flake8 linter, r=jmaher
This is needed before we can upgrade to flake8 3.3.0, as that version starts flagging these errors.

These files were modified by running:
autopep8 --select E305 --in-place -r <dir>

on the affected directories. I did it one dir at a time and verified the result after each.

MozReview-Commit-ID: FmlsfiKIbtr
2017-06-15 12:10:59 -04:00
Sam Giles 7d3678242b Bug 1340429 - Bump mozprocess to 0.24; r=jgraham
MozReview-Commit-ID: G3473IJp0i2
2017-02-17 05:53:06 +00:00
Sam Giles a58191be63 Bug 1329528 - Reap zombie processes on Mac OS if killing the process group initially fails with EPERM; r=ahal
MozReview-Commit-ID: IKqXKIN0mXx
2017-02-16 06:18:17 +00:00
Andrew Halberstadt 64e33c7c26 Bug 1003417 - Add a 'mozbase' subsuite to python unittests on linux, r=ted
The subsuite is added conditionally because we only have the capability of
running source-check tasks on linux at the moment. Once taskcluster support
for windows and mac has matured a bit and the taskcluster configs support
source-check there, we should apply the subuite unconditionally.

MozReview-Commit-ID: Kk9Irz3fn14
2016-11-16 16:43:42 -05:00
James Graham 12722ebdb6 Bug 1328823 - Bump mozprocess version number to 0.24 for release, r=ahal
MozReview-Commit-ID: 251xwdA7rxc
2017-01-06 15:39:55 +00:00
Andrew Halberstadt e7efd21c97 Bug 1317970 - Make mozbase tests use mozunit for consistent formatting, r=chmanchester
The mozbase unittests don't use mozunit, so their output is confusing in the log.
This makes mozbase output consistent with the rest of the python unittests.

MozReview-Commit-ID: AIs5mza8Rn6
2016-11-17 16:36:18 -05:00
Andrew Halberstadt 2c8354889d Bug 1309060 - Ignore "No such process" when trying to find pgid in mozprocess, r=gps
For some reason calling os.getpgid(proc.pid) in this bug results in an OSError "No such process"
on OSX. This bug is starting the ProcessHandler from a concurrent.futures Thread, that must be
somehow related.

I tried debugging this, but couldn't figure out why this is happening. However, the pgid is not
needed for this use case, and simply ignoring the error works. We also ignore this very same
exception when calling os.getpgid elsewhere in mozprocess, so there must be some weird OSXism
happening.

MozReview-Commit-ID: 2YXhBaORC5s
2016-11-03 10:24:11 -04:00
Francesco Pischedda 46c0d4af68 Bug 1280573 - Add testing/mozbase to flake8 linter: r=ahal
added testing/mozbase to tools/lint/flake8.lint
fixed a first batch of PEP8 errors/warnings

at first the commad autopep8 -i --max-line-length 99 -r -j 8 .
has been used to fix simpler problems, run from testing/mozbase

some of the issues can not easily fixed :
- undefined 'names' in code for example isLinux - isLinux and isBsd "fixed" with # noqa
- undefined 'message' resolved with return fmt.format(...
- undefined 'structured' resolved replacing those with mozlog
- long comments - some remaining - addressed with # noqa
- package level import everything - addressed with # flake8: noqa

restored testing/mozbase/mozdevice/mozdevice/Zeroconf.py
fixed issues reported on mozreview
fixed ')' in testing/mozbase/mozprocess/mozprocess/qijo.py imports
finally fixed multiline string at testing/mozbase/manifestparser/tests/test_manifestparser.py:114
^^^ and again, but now with ./mach python-test --path-only testing/mozbase/manifestparser/tests/test_manifestparser.py passing
fixed testing/mozbase/manifestparser/tests/test_convert_directory.py assert

fixed this error:
10:15:21     INFO -      return lambda line: stack_fixer_module.fixSymbols(line)
10:15:21     INFO -  TypeError: fixSymbols() takes exactly 2 arguments (1 given)

fixed two spaces lint error even of #  noqa comments
restored assignement to lambda with #  noqa to silence the lint error
global noqa for testing/mozbase/manifestparser/tests/test_filters.py
stupid is/is not error...

MozReview-Commit-ID: 1FpJF54GqIi
2016-09-30 16:08:37 +02:00
Henrik Skupin 3ec2b05195 Bug 1176758 - Release mozprocess 0.23 and mozrunner 6.12. r=ahal
MozReview-Commit-ID: JeQhPhZHbUX
2016-06-30 16:45:21 +02:00
Henrik Skupin deb4edc65b Bug 1176758 - Allow mozprocess to detect and kill detached child processes. r=ahal
MozReview-Commit-ID: B9yfLYUZw76
2016-06-30 16:44:56 +02:00
Henrik Skupin c6fad69222 Bug 1276886 - [mozprocess] Fix hang in output readers when process is in a new process group. r=ahal
MozReview-Commit-ID: 9e6HNAaF0Yo

In case of in-process restarts it can happen that the new process gets forked into a new process group.
When that happens we loose the capability to kill the process. To prevent a hang when joining the output
reader threads in wait(), we simply skip that call by passing-through the IO error.
2016-06-02 20:19:34 +02:00
Andrew Halberstadt 6203007b01 Bug 1274584 - [mozprocess] Fix IO Completion Port failed to signal process shutdown, r=jgriffin
Sometimes the IO completion port doesn't shutdown child processes. When this happens,
mozprocess will attempt to force kill the child processes manually. However, there is
a bug here which causes the OSError to get raised.

Although this fixes that bug, the original issue(s) which prevented the IOC port
from signaling shutdown remain and are still undiagnosed.

MozReview-Commit-ID: L3DQPW0Is5v
2016-05-30 11:02:13 -04:00
Andrew Halberstadt f8dbd54b94 Bug 1274584 - [mozprocess] Improve debugging messages on windows, r=jgriffin
We can set MOZPROCESS_DEBUG to help debug windows process code. However on try
it is unreadable as there are multiple things using mozprocess, and each process
has multiple threads. It's impossible to tell which log message comes from where.
This improves the debug logs a bit by always specifying the PID and thread name.

There are a few other drive-by cleanups in this thread. The only one of note is
removing a python 2.5 only code path.

MozReview-Commit-ID: L3DQPW0Is5v
2016-05-30 11:00:59 -04:00
Andrew Halberstadt 35b222b6bc Bug 1152428 - [mozprocess] Fix UnicodeEncodeError when non-ascii characters are in the environment, r=wlach
MozReview-Commit-ID: 3AG9oLxWexy
2016-03-16 11:07:35 -04:00
Ms2ger 07bc6570cf Bug 1257510 - Use modern exception syntax in mozbase; r=ahal
The comma form is long-deprecated.
2016-03-18 09:03:25 +01:00
Chris Manchester 8fcb2504dc Bug 1055224 - Run gtest output through a stack fixer. r=ahal 2016-01-15 10:36:46 -08:00
Julien Pagès df1b0a5c30 Bug 1215756 - Fix mozprocess unit tests failures. r=ahal
This now check process status based on pids, not anymore
on an arbitrary string given in the command line.

Some cleanup in there, including removing code duplicate.
2015-10-21 10:57:58 -04:00
Julien Pagès a135bcc459 Bug 1139487 - Remove mozprocess.pid, mozprocess.wpk. r=jmaher 2015-10-06 21:35:43 +02:00
Gregory Szorc ee772dd01c Bug 1176642 - Fix typo in import name; r=smacleod
This regressed in 101600812e66.
2015-06-25 13:06:25 -07:00
Gregory Szorc 33108bc80d Bug 1176642 - Use relative imports in mozprocess; r=smacleod
This regressed in 101600812e66.
2015-06-25 12:55:48 -07:00
Gregory Szorc c19bb34652 Bug 1176642 - Use absolute_import, remove unused imports from mozprocess; r=chmanchester 2015-06-25 12:13:27 -07:00
Julien Pagès d3ff1ba9d5 Bug 1124695 - [mozrunner] and/or [mozprocess] should send SIGTERM before sending SIGKILL by default; r=ahal 2015-02-27 15:11:14 -05:00
Philip Chee 93fe81dda2 Bug 1050561 - Decode string when building an environment block to support non-ASCII environment variables. r=ahalberstadt 2015-04-07 16:09:49 +08:00
Julien Pagès 583cc85136 Bug 1088192 - mozprocess.ProcessHandlerMixin does not handle missing property "proc" on unstarted processes. r=ahal 2015-03-17 01:10:00 +01:00
Julien Pagès 60403af4fd Bug 923381 - [mozprocess] mozprocess.ProcessHandler should have an option not to print. r=ahal 2015-03-12 13:38:00 +01:00
Chris Manchester aaf58d24f3 Bug 1140507 - Bump mozprocess version and release to pypi to pick up recent changes.;r=ahal DONTBUILD 2015-03-06 13:55:58 -08:00
Chris Manchester 217ae30860 Bug 1139722 - Allow use of nested job objects in mozprocess on windows versions that support them.;r=ahal
This patch detects when breaking away from the parent job isn't strictly necessary to manage processses in a new job to allow using nested job objects to manage processes and their children. Loss of job object functionality is handled in mozprocess as non-fatal, however mozrunner and others doing things like restarting firefox require it.
2015-03-05 18:02:38 -08:00
Ted Mielczarek cf4d24f610 bug 1137228 - use readline instead of iterator for reading mozprocess output. r=ahal 2015-02-26 15:16:59 -05:00
Julien Pagès 30e5370b67 Bug 794984 - [mozprocess] Add ability to separate stderr from stdout. r=ahal
A new parameter called 'processStderrLine' is added. When specified, stdout gets processed by the
'processOutputLine' callbacks and stderr is processed by the 'processStderrLine' callbacks. When
not specified, stderr is redirected to stdout which is the same default behaviour.

A side effect of this is that mozprocess now uses three threads to process output. One thread each
for stdout and stderr that reads output lines and stores them in a Queue as fast as possible, this
makes sure there is no blocking in stdout.write(). A third thread executes the callbacks.
2015-02-23 07:39:00 -05:00
Andrew Halberstadt 446d3822a8 Bug 1060527 - [mozprocess] signal finished if IO completion port unexpectedly closed on windows, r=jgriffin 2014-11-14 08:47:32 -05:00
Pankaj Malhotra(:bitgeeky) 83257926f9 Bug 1064960 - [mozprocess] Guard against the output thread trying to join with itself. r=ahal 2014-11-04 02:35:00 +01:00
Daniel Lee 12074fb723 Bug 705864 - [mozprocess] mozprocess tests should use mozprocess.pid. r=ahal 2014-10-07 07:00:40 -07:00
Daniel Lee 03d9ef2125 Bug 1067008 - [mozprocess] mozprocess.pid running_process should look at the entire command not just the executable name. r=ahal 2014-09-16 16:56:21 -07:00
Armen Zambrano Gasparnian 2d0ced7917 Bug 1051799 - [mozprocess] Bump mozprocess to 0.21. r=wlach. DONTBUILD 2014-08-11 11:36:01 -04:00
Armen Zambrano Gasparnian 2ffce3f557 Bug 1046087 - Normalize line endings on mozprocess for Adb Windows. r=wlach 2014-08-11 08:59:56 -04:00
Ryan VanderMeulen fc8234b5ef Backed out changeset 735394aa3813 (bug 1046087) for Windows bustage.
CLOSED TREE
2014-08-08 13:01:25 -04:00
Armen Zambrano Gasparnian da52a3a1e7 Bug 1050756 - Bump mozprocess to 0.20. r=wlach. DONTBUILD 2014-08-08 09:10:12 -04:00
Armen Zambrano Gasparnian 1ffc7189a7 Bug 1046087 - Normalize line endings on Windows. r=wlach
We have found out that the output of Adb on Windows ends with
\r\r\n rather than \r\n. This abnormal line ending cannot be
dealt properly with python's universal_lines. Instead we
decided to normalize every line ending to \n.
2014-08-08 08:47:05 -04:00
Armen Zambrano Gasparnian 50e9d28297 Bug 1026710 - Make DeviceManagerADB use mozprocess to allow logging. r=wlach
Up until now, mozdevice has been using subprocess. The switch gives us the
ability to log adb commands and its output. This will be mainly used
for the Firefox OS cert suite.
2014-07-15 08:59:48 -04:00
Chris Manchester 4a33d5736b Bug 1035006 - Fix pyflakes warnings in mozbase.;r=wlach 2014-07-07 14:51:34 -04:00
Sylvestre Ledru d288b8263a Bug 991866: Catch the exception and returns the iso8859-1 string. In some cases, the display was failing r=ahal 2014-07-04 12:07:38 +02:00
Andrew Halberstadt df364bfcf8 Bug 997244 - Move emulator.py out of marionette and into mozrunner, r=wlach,mdas,jgriffin 2014-06-19 14:17:26 -04:00
Ryan VanderMeulen 981100635a Backed out changeset 12536416d070 (bug 991866) for breaking B2G mochitests.
CLOSED TREE
2014-06-04 16:04:14 -04:00
Andrew Halberstadt 221657f55a Bug 991866 - Decode mozprocess output before printing to stdout, r=gps 2014-06-04 15:00:01 -04:00
James Graham e4ab7a09e9 Bug 991727 - Update mozprocess version due to API change, r=ahal 2014-04-03 22:19:31 +01:00
dadadel 47ab9c162e Bug 975136 - Test mozprocess parameters;r=wlach
DONTBUILD
2014-03-10 12:34:03 -04:00
Andrew Halberstadt e80f8c74de Bug 967647 - Enforce an unbuffered stream by default in mozprocess, r=jgriffin 2014-03-03 15:16:54 -05:00
dadadel 5d57d33daf Bug 975136 - Fix mozprocess to accept single function or array of functions for onTimeout/onFinish, update docs;r=wlach 2014-02-21 16:33:30 -05:00
Andrew Halberstadt d3a120536c Bug 949600 - Sync mozbase to m-c one last time, r=wlach 2014-02-19 16:42:01 -05:00