Closed
Bug 463046
Opened 17 years ago
Closed 17 years ago
Network connectivity checking breaks running netwerk unit tests and mochitests with no connection
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.9.2a1
People
(Reporter: Waldo, Assigned: dcamp)
References
Details
Attachments
(1 file, 1 obsolete file)
7.78 KB,
patch
|
beltzner
:
approval1.9.1-
|
Details | Diff | Splinter Review |
During time spent on flights recently I did most of the hacking to create the patch in bug 462864. Naturally, I didn't have a net connection. When I went to find the first obvious bugs in the patch by running just the httpd.js tests in netwerk/test/httpserver/test, I discovered after gdbing that netwerk was trying to be smart, determining at startup that no net connection was present, and shutting down the socket transport service. With that shut down, the asyncListen method on server sockets used in the HTTP server would throw an exception, and the tests would fail.
This isn't exactly a common scenario, but is there some way to make netwerk not try to be too smart here? This change means anyone hacking offline on a Mac and trying to run tests on patches is in for a rude surprise, even though all of it would work perfectly fine if it were allowed to do so.
![]() |
||
Comment 1•17 years ago
|
||
This made it impossible for me to run mochitests today as well...
Summary: Network connectivity checking breaks running netwerk unit tests with no connection → Network connectivity checking breaks running netwerk unit tests and mochitests with no connection
Comment 2•17 years ago
|
||
FWIW, bug 424626 added a pref "toolkit.networkmanager.disable" to override this behavior on Linux:
http://hg.mozilla.org/mozilla-central/annotate/c04e27e056ba/toolkit/system/dbus/nsNetworkManagerListener.cpp
Assignee | ||
Comment 3•17 years ago
|
||
I wonder why this hasn't bitten us on Windows before..
Attached patch adds a pref to turn off link detection, and uses it in mochitests. xpcshell and the mochitest server just set up the ioservice manually.
Reftests were mentioned when we discussed this on irc, so I did something similar to the xpcshell change there.
Assignee: nobody → dcamp
Attachment #355662 -
Flags: review?
Assignee | ||
Updated•17 years ago
|
Attachment #355662 -
Flags: review?(jwalden+bmo)
Attachment #355662 -
Flags: review?(bzbarsky)
Attachment #355662 -
Flags: review?
Reporter | ||
Updated•17 years ago
|
Attachment #355662 -
Flags: review?(jwalden+bmo) → review+
Reporter | ||
Comment 4•17 years ago
|
||
Comment on attachment 355662 [details] [diff] [review]
v1
>diff -r 91fd1000d75d layout/tools/reftest/reftest-cmdline.js
>+ /* Ignore the platform's online/offline status while running reftests. */
>+ var ios = Cc["@mozilla.org/network/io-service;1"]
>+ .getService(Ci.nsIIOService2)) {
>+ ios.manageOfflineStatus = false;
>+ ios.offline = false;
Copy-paste error above.
>diff -r 91fd1000d75d netwerk/base/src/nsIOService.cpp
>+ if (!pref || strcmp(pref, MANAGE_OFFLINE_STATUS_PREF) == 0) {
>+ PRBool manage;
>+ nsresult rv = prefs->GetBoolPref(MANAGE_OFFLINE_STATUS_PREF, &manage);
>+ if (NS_SUCCEEDED(rv)) {
>+ SetManageOfflineStatus(manage);
> }
> }
The temporary doesn't seem necessary, just wrap the call in the NS_SUCCEEDED, and the single-line bracing seems unstylish in this code.
Otherwise, this looks good.
![]() |
||
Comment 5•17 years ago
|
||
Where does the IOService get this pref on startup?
Assignee | ||
Comment 6•17 years ago
|
||
PrefsChanged() is called at startup (right after the observer is hooked up)
![]() |
||
Updated•17 years ago
|
Attachment #355662 -
Flags: review?(bzbarsky) → review+
![]() |
||
Comment 7•17 years ago
|
||
Comment on attachment 355662 [details] [diff] [review]
v1
Ah, ok.
Assignee | ||
Comment 8•17 years ago
|
||
Attachment #355662 -
Attachment is obsolete: true
Attachment #355692 -
Flags: approval1.9.1?
Assignee | ||
Comment 9•17 years ago
|
||
Landed on mozilla-central: http://hg.mozilla.org/mozilla-central/rev/5eeab4033c20
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Target Milestone: --- → mozilla1.9.2a1
Version: unspecified → Trunk
Comment 10•17 years ago
|
||
Comment on attachment 355692 [details] [diff] [review]
review comments fixed
Bug 446300 moved
/tools/test-harness/xpcshell-simple/
...
Comment 11•16 years ago
|
||
Comment on attachment 355692 [details] [diff] [review]
review comments fixed
This doesn't feel like it's really needed for the 191 branch, which will be going out of primary development in a few months.
Renominate if you feel strongly, and express why!
Attachment #355692 -
Flags: approval1.9.1? → approval1.9.1-
You need to log in
before you can comment on or make changes to this bug.
Description
•