[bcc dev-tree-management]

In the continuing effort to make our testsuites more reliable, bug 995417 has 
landed on inbound.  This bug enforces the long-standing policy of no external 
network connections in the testsuite with code: external network connections 
will now crash the browser if and when they occur during tests, rather than 
intermittently causing failures.  A non-exhaustive list of things blocked by 
this:

- A test that connects to [well-known site];
- A test that connects to [reliable Mozilla service];
- A test that downloads from [widely-used content distribution network]; and
- Triggered-by-timer update checks for select pieces of browser functionality.

An informative message about what host was being connected to, along with a 
short list of suggestions of what to fix, is printed out on stderr and/or 
logcat prior to the crash.

What do you do if you hit one of these errors?  A mostly-exhaustive list, 
garnered from the bugs fixed so that bug 995417 could land:

- If you need a "real hostname" during mochitests, you can find a list of 
origins that we support via a test-only networking proxy in:

http://mxr.mozilla.org/mozilla-central/source/build/pgo/server-locations.txt

- Services that require actual servers (e.g. telemetry, sync, Firefox accounts, 
etc.) during mochitests should set the appropriate pref in:

http://mxr.mozilla.org/mozilla-central/source/testing/profiles/prefs_general.js

to be pointed at a local server.  The local server won't have any 
service-specific content, of course.  If pointing those services at a local 
server is inappropriate, then disabling the service for the tests via prefs is 
a good course of action.

- In other testsuites, such as reftests/crashtests/jsreftests, you should 
disable the appropriate service via prefs in:

http://mxr.mozilla.org/mozilla-central/source/layout/tools/reftest/runreftest.py
 (reftests/crashtests)
http://mxr.mozilla.org/mozilla-central/source/js/src/tests/user.js (jsreftests)

(If you're thinking "why am I setting prefs in all these different places?" 
please be aware that these are the most common ones, and that we'd love your 
help in bug 1023483 in fixing this state of affairs! :)

- For xpcshell, you should set up mock servers via httpd.js (see numerous 
examples in existing xpcshell tests).

- If you need a host that doesn't exist (e.g. testing XMLHttpRequest error 
behavior), you ought to be able to just make one up.  Make it sufficiently 
whimsical.

Thanks,
-Nathan
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to