karma-firefox-launcher icon indicating copy to clipboard operation
karma-firefox-launcher copied to clipboard

Firefox begin update when karma launch it

Open Mingun opened this issue 6 years ago • 3 comments

Of course because of it tests are not runned. I think, there shall be a method to forbid auto update of the browser when test starts. I get following output to the console:

D:\Projects\other\structured-diff>npm run browser

> [email protected] browser D:\Projects\other\structured-diff
> karma start

04 04 2018 22:34:36.038:DEBUG [config]: Loading config D:\Projects\other\structured-diff\karma.conf.js
04 04 2018 22:34:36.082:DEBUG [plugin]: Loading karma-* from D:\Projects\other\structured-diff\node_modules
04 04 2018 22:34:36.095:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-browserify.
04 04 2018 22:34:36.500:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-chrome-launcher.
04 04 2018 22:34:36.547:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-firefox-launcher.
04 04 2018 22:34:36.562:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-mocha.
04 04 2018 22:34:36.576:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-mocha-reporter.
04 04 2018 22:34:36.821:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-opera-launcher.
04 04 2018 22:34:36.833:DEBUG [plugin]: Loading plugin D:\Projects\other\structured-diff\node_modules/karma-sauce-launcher.
04 04 2018 22:34:38.608:DEBUG [framework.browserify]: created browserify bundle: C:\Users\mingun\AppData\Local\Temp\39d0116d299ec0c95803c09842d37005.browserify
04 04 2018 22:34:38.731:DEBUG [framework.browserify]: add bundle to config.files at position 0
04 04 2018 22:34:38.762:DEBUG [web-server]: Instantiating middleware
04 04 2018 22:34:38.770:DEBUG [reporter]: Trying to load reporter: mocha
04 04 2018 22:34:38.785:DEBUG [reporter]: Trying to load color-version of reporter: mocha (mocha_color)
04 04 2018 22:34:38.792:DEBUG [reporter]: Couldn't load color-version.

START:
04 04 2018 22:34:39.065:DEBUG [framework.browserify]: building bundle
04 04 2018 22:34:39.073:DEBUG [framework.browserify]: updating lib\diff.js in bundle
04 04 2018 22:34:39.077:DEBUG [framework.browserify]: updating lib\hunk.js in bundle
04 04 2018 22:34:39.114:DEBUG [framework.browserify]: updating lib\inline.js in bundle
04 04 2018 22:34:39.118:DEBUG [framework.browserify]: updating lib\object.js in bundle
04 04 2018 22:34:39.195:DEBUG [framework.browserify]: updating lib\word-diff.js in bundle
04 04 2018 22:34:39.249:DEBUG [framework.browserify]: updating lib\unified.js in bundle
04 04 2018 22:34:39.262:DEBUG [framework.browserify]: updating test\diff.js in bundle
04 04 2018 22:34:39.269:DEBUG [framework.browserify]: updating test\hunk.js in bundle
04 04 2018 22:34:39.314:DEBUG [framework.browserify]: updating test\inline.js in bundle
04 04 2018 22:34:39.318:DEBUG [framework.browserify]: updating test\unified.js in bundle
04 04 2018 22:34:40.040:DEBUG [framework.browserify]: bundling
04 04 2018 22:34:44.039:INFO [framework.browserify]: bundle built
04 04 2018 22:34:44.095:INFO [karma]: Karma v2.0.0 server started at http://0.0.0.0:9876/
04 04 2018 22:34:44.104:INFO [launcher]: Launching browser Firefox with unlimited concurrency
04 04 2018 22:34:44.146:INFO [launcher]: Starting browser Firefox
04 04 2018 22:34:44.158:DEBUG [temp-dir]: Creating temp dir at C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:44.168:DEBUG [launcher]: D:\Полезные программы\Mozilla Firefox\firefox.exe http://localhost:9876/?id=11747892 -profile C:\Users\mingun\AppData\Local\Temp\karma-11747892 -no-remote
04 04 2018 22:34:44.999:DEBUG [launcher]: Process Firefox exited with code 0
04 04 2018 22:34:45.001:ERROR [launcher]: Cannot start Firefox

04 04 2018 22:34:45.002:ERROR [launcher]: Firefox stdout:
04 04 2018 22:34:45.002:ERROR [launcher]: Firefox stderr:
04 04 2018 22:34:45.005:DEBUG [temp-dir]: Cleaning temp dir C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:45.026:INFO [launcher]: Trying to start Firefox again (1/2).
04 04 2018 22:34:45.029:DEBUG [launcher]: Restarting Firefox
04 04 2018 22:34:45.030:DEBUG [temp-dir]: Creating temp dir at C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:45.035:DEBUG [launcher]: D:\Полезные программы\Mozilla Firefox\firefox.exe http://localhost:9876/?id=11747892 -profile C:\Users\mingun\AppData\Local\Temp\karma-11747892 -no-remote
04 04 2018 22:34:46.194:DEBUG [launcher]: Process Firefox exited with code 0
04 04 2018 22:34:46.196:ERROR [launcher]: Cannot start Firefox

04 04 2018 22:34:46.197:ERROR [launcher]: Firefox stdout:
04 04 2018 22:34:46.198:ERROR [launcher]: Firefox stderr:
04 04 2018 22:34:46.199:DEBUG [temp-dir]: Cleaning temp dir C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:46.219:INFO [launcher]: Trying to start Firefox again (2/2).
04 04 2018 22:34:46.221:DEBUG [launcher]: Restarting Firefox
04 04 2018 22:34:46.223:DEBUG [temp-dir]: Creating temp dir at C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:46.228:DEBUG [launcher]: D:\Полезные программы\Mozilla Firefox\firefox.exe http://localhost:9876/?id=11747892 -profile C:\Users\mingun\AppData\Local\Temp\karma-11747892 -no-remote
04 04 2018 22:34:47.817:DEBUG [launcher]: Process Firefox exited with code 0
04 04 2018 22:34:47.820:ERROR [launcher]: Cannot start Firefox

04 04 2018 22:34:47.822:ERROR [launcher]: Firefox stdout:
04 04 2018 22:34:47.823:ERROR [launcher]: Firefox stderr:
04 04 2018 22:34:47.826:DEBUG [temp-dir]: Cleaning temp dir C:\Users\mingun\AppData\Local\Temp\karma-11747892
04 04 2018 22:34:47.836:ERROR [launcher]: Firefox failed 2 times (cannot start). Giving up.

Finished in 0 secs / 0 secs @ 22:34:47 GMT+0500 (Уральское время (зима))

04 04 2018 22:34:47.846:DEBUG [karma]: Run complete, exiting.
04 04 2018 22:34:47.849:DEBUG [launcher]: Disconnecting all browsers
04 04 2018 22:34:47.852:DEBUG [framework.browserify]: cleaning up

npm ERR! Windows_NT 6.0.6001
npm ERR! argv "D:\\Scripts\\JavaScript\\node.exe" "D:\\Scripts\\JavaScript\\node_modules\\npm\\bin\\npm-cli.js" "run" "browser"
npm ERR! node v5.12.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! [email protected] browser: `karma start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] browser script 'karma start'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the structured-diff package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     karma start
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs structured-diff
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls structured-diff
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Projects\other\structured-diff\npm-debug.log

D:\Projects\other\structured-diff>

Mingun avatar Apr 04 '18 17:04 Mingun

Setting the launcher prefs 'app.update.enabled': false should prevent Firefox from updating.

mschaaf avatar Feb 18 '20 14:02 mschaaf

Looks like this is now app.update.disabledForTesting as of bug 1420514 but, as the name suggests, it only applies when either the browser is being run in automation or marionette:

  • https://searchfox.org/mozilla-central/rev/2cd2d511c0d94a34fb7fa3b746f54170ee759e35/toolkit/mozapps/update/UpdateService.jsm#3070

Digging into the definition of IsInAutomation:

  • https://searchfox.org/mozilla-central/rev/2cd2d511c0d94a34fb7fa3b746f54170ee759e35/js/xpconnect/src/xpcpublic.h#687-693

it looks like it's based on whether or not security has been turned off. That's probably why the patches that introduced this pref also flipped security.turn_off_all_security_so_that_viruses_can_take_over_this_computer on in a number of places:

e.g.

  • https://hg.mozilla.org/integration/autoland/rev/7ca13add114d#l3.12
  • https://hg.mozilla.org/integration/autoland/rev/7ca13add114d#l4.13
  • https://hg.mozilla.org/integration/autoland/rev/7ca13add114d#l5.13
  • https://hg.mozilla.org/integration/autoland/rev/7ca13add114d#l7.15
  • etc.

So presumably we need to flip those two prefs. I'm not entirely sure if that's desirable. I mean, viruses are bad.

birtles avatar Apr 14 '20 07:04 birtles

Oh wait, according to https://bugzilla.mozilla.org/show_bug.cgi?id=1420514#c48 the MOZ_DISABLE_NONLOCAL_CONNECTIONS environment variable also needs to be set. I'm guessing we don't want to set that for karma-runner however.

So, there might be nothing we can do here. Basically, the pref is gone. The only other option is to try to set an enterprise policy but that sounds complicated.

birtles avatar Apr 14 '20 07:04 birtles