Closed Bug 1053340 Opened 10 years ago Closed 10 years ago

B2G mochitests connect to dynamicua.cdn.mozilla.net due to user agent updates not being disabled ([@ nsSocketTransport::InitiateSocket()], mozrunner-startup)

Categories

(Firefox OS Graveyard :: Gaia::Browser, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: emorley, Unassigned)

References

Details

(Keywords: intermittent-failure)

For tests jobs in automation to meet the visibility policy (https://wiki.mozilla.org/Sheriffing/Job_Visibility_Policy), they must not make external connections. Bug 1039019 is trying to enable MOZ_DISABLE_NONLOCAL_CONNECTIONS for B2G mochitests (carrying on the work started in bug 995417), however I'm seeing the following attempted connections intermittently during B2G mochitests: dynamicua.cdn.mozilla.net (93.184.215.191) https://tbpl.mozilla.org/php/getParsedLog.php?id=45847614&tree=Try#error4 07:54:06 INFO - 08-13 14:48:00.376 I/Gecko ( 44): 1407941280379 Marionette INFO sendToClient: {"from":"0","ok":true}, {1831f278-c04a-4dfb-a69a-981b152b1fd7}, {1831f278-c04a-4dfb-a69a-981b152b1fd7} 07:54:06 INFO - 08-13 14:48:13.386 I/Gecko ( 44): --DOMWINDOW == 7 (0x49aa38e0) [pid = 44] [serial = 4] [outer = 0x449b5e20] [url = about:blank] 07:54:06 INFO - 08-13 14:48:14.967 I/Gecko ( 44): [44] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80520012: file ../../../../gecko/content/base/src/nsScriptLoader.cpp, line 381 07:54:06 INFO - 08-13 14:48:17.236 I/Gecko ( 44): *** UTM:SVC TimerManager:notify - notified timerID: user-agent-updates-timer 07:54:06 INFO - 08-13 14:48:17.236 E/GeckoConsole( 44): UTM:SVC TimerManager:notify - notified timerID: user-agent-updates-timer 07:54:06 INFO - 08-13 14:48:17.246 E/GeckoConsole( 44): [JavaScript Warning: "assignment to undeclared variable lastUpdateTime" {file: "jar:file:///system/b2g/omni.ja!/components/nsUpdateTimerManager.js" line: 239}] 07:54:06 INFO - 08-13 14:48:17.287 I/Gecko ( 44): FATAL ERROR: Non-local network connections are disabled and a connection attempt to dynamicua.cdn.mozilla.net (93.184.215.191) was made. 07:54:06 INFO - 08-13 14:48:17.287 I/Gecko ( 44): You should only access hostnames available via the test networking proxy (if running mochitests) or from a test-specific httpd.js server (if running xpcshell tests). Browser services should be disabled or redirected to a local server. MXR shows: http://mxr.mozilla.org/mozilla-central/search?string=dynamicua.cdn.mozilla.net http://mxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js#854 line 854 -- pref("general.useragent.updates.url", "https://dynamicua.cdn.mozilla.net/0/%APP_ID%"); Then: http://mxr.mozilla.org/mozilla-central/search?string=general.useragent.updates http://mxr.mozilla.org/mozilla-central/source/b2g/app/b2g.js#853 line 853 -- pref("general.useragent.updates.enabled", true); line 854 -- pref("general.useragent.updates.url", "https://dynamicua.cdn.mozilla.net/0/%APP_ID%"); line 855 -- pref("general.useragent.updates.interval", 604800); // 1 week line 856 -- pref("general.useragent.updates.retry", 86400); // 1 day http://mxr.mozilla.org/mozilla-central/source/dom/base/SiteSpecificUserAgent.js#12 line 12 -- const PREF_UPDATE = "general.useragent.updates."; http://mxr.mozilla.org/mozilla-central/source/netwerk/protocol/http/UserAgentUpdates.jsm#43 line 43 -- const PREF_UPDATES = "general.useragent.updates."; http://mxr.mozilla.org/mozilla-central/source/netwerk/test/mochitests/test_user_agent_updates.html?force=1#19 line 19 -- const PREF_UPDATES = "general.useragent.updates."; http://mxr.mozilla.org/mozilla-central/source/testing/profiles/prefs_general.js#185 line 185 -- user_pref("general.useragent.updates.enabled", false); My thoughts: 1) The updates should be disabled, given the entry in prefs_general.js - this should work, so either: a) Somewhere we are not checking that pref before making the request. b) We're racing with the test re-enabling the updates (http://mxr.mozilla.org/mozilla-central/source/netwerk/test/mochitests/test_user_agent_updates.html?force=1#118 and http://mxr.mozilla.org/mozilla-central/source/netwerk/test/mochitests/test_user_agent_updates.html?force=1#176) 2) Failing #1, we could just set the URL in prefs_general.js to localhost like others. 3) We should probably also fix "[JavaScript Warning: "assignment to undeclared variable lastUpdateTime" {file: "jar:file:///system/b2g/omni.ja!/components/nsUpdateTimerManager.js" line: 239}]" in the log excerpt above. Jim, as the author of bug 897221 - would you mind taking a quick look at this and letting me know what you think? :-)
Flags: needinfo?(nchen)
I looked at the code and it looks to check the pref correctly. How is prefs_general.js loaded? The pref is default on for b2g (and only b2g), so if prefs_general.js doesn't get loaded immediately or if the changes get reverted at the end of testing, there will a window where the pref is on (again only on b2g). Since this only seems to affect b2g, it makes me wonder if this is the case.
Flags: needinfo?(nchen)
So if the above is true, I don't think even setting the URL in prefs_general.js will work :(
Summary: B2G mochitests connect to dynamicua.cdn.mozilla.net due to user agent updates not being disabled → B2G mochitests connect to dynamicua.cdn.mozilla.net due to user agent updates not being disabled ([@ nsSocketTransport::InitiateSocket()], mozrunner-startup)
Blocks: 1061703
No longer blocks: 1039019
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.