The default bug view has changed. See this FAQ.

Marionette's printLogs should write to stderr instead of stdout

RESOLVED FIXED in mozilla18


5 years ago
5 years ago


(Reporter: jgriffin, Assigned: hao)



Firefox Tracking Flags

(Not tracked)


(Whiteboard: [mentor=mdas][lang=py][good first bug])


(1 attachment)



5 years ago
Marionette uses Python's unittest runner to run tests.  TextTestRunner outputs test results to stderr, instead of stdout, to avoid the buffering that takes places with stdout. 

Marionette's printLogs function (, on the other hand, just uses print, which goes to stdout.  This does get buffered, and the result is, when running a sequence of tests, that the log info does not get printed immediately after a test, as is desired, but sometime later, when the stdout buffer gets flushed.

To fix this, we should have printLogs output to, which by default is sys.stderr.

Comment 1

5 years ago
If I made some changes to the code, how can I verify the result? Run the

Comment 2

5 years ago
(In reply to Hao Gao from comment #1)
> If I made some changes to the code, how can I verify the result? Run the

Yes, you can run it with desktop Firefox using a command-line like this:

python --address localhost:2828 --binary /path/to/firefox --type browser tests/unit-tests.ini

Comment 3

5 years ago
I should add that in order to get a Firefox build that has Marionette enabled, you should download a debug build from e.g., (or other, depending on your platform).

Comment 4

5 years ago
Created attachment 659003 [details] [diff] [review]
a patch

Please review it.
Attachment #659003 - Flags: review?(jgriffin)

Comment 5

5 years ago
Comment on attachment 659003 [details] [diff] [review]
a patch

Review of attachment 659003 [details] [diff] [review]:

Looks great, thanks for contributing a patch!
Attachment #659003 - Flags: review?(jgriffin) → review+

Comment 6

5 years ago
Assignee: nobody → haog
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.