karma-firefox-launcher: Launcher doesn't kill Firefox 68
Firefox : v68.0.1 OS : Window7 and Windows 10 Karma : v1.7.1 || v3.1.4 || 4.2.0 Firefox launcher : v1.1.0 Node.js : v8 || v10
Launcher doesn’t kill my Firefox 68, I tested with several version of nodejs without success. Maybe it’s cause of Electrolyse (e10s) maybe not. I tried to disable e10s for a moment with set MOZ_FORCE_DISABLE_E10S variable but unsuccessful, I created a little standalone code to test.
const spawn = require('child_process').spawn;
let firefox = spawn("pathToFirefox\\firefox.exe, [
"http://localhost:9876/?id=anid",
"-profile",
"C:\\temp\karma-2456",
"-no-remote",
"-wait-for-browser"
]);
setTimeout(function killFirefox(){
firefox.kill();
}, 10000)
firefox.on('exit', function(code, signal){
console.log('Firefox exit');
});
Result: firefox is always running.
I tried with this version How to kill child processes that spawn their own child processes in Node.js but it doesn’t work for me.
has anybody an idea ?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 3
- Comments: 20 (4 by maintainers)
Commits related to this issue
- fix: Detect and kill browser process when launcher process is being used (#103) Fixes #101. — committed to karma-runner/karma-firefox-launcher by birtles 5 years ago
- fix: launcher does not kill firefox.exe on WSL Record PIDs for firefox.exe on WSL and kill all processes not recorded on start-up For full discussion see: https://github.com/karma-runner/karma-fire... — committed to dotnetCarpenter/karma-firefox-launcher by dotnetCarpenter 3 years ago
- fix: launcher does not kill firefox.exe on WSL Record PIDs for firefox.exe on WSL and kill all processes not recorded on start-up For full discussion see: https://github.com/karma-runner/karma-... — committed to karma-runner/karma-firefox-launcher by dotnetCarpenter 3 years ago
- chore(release): 2.1.2 [skip ci] ## [2.1.2](https://github.com/jginsburgn/karma-firefox-launcher/compare/v2.1.1...v2.1.2) (2021-11-02) ### Bug Fixes * launcher does not kill firefox.exe on WSL ([395... — committed to jginsburgn/karma-firefox-launcher by semantic-release-bot 3 years ago
- chore(release): 2.1.2 [skip ci] ## [2.1.2](https://github.com/jginsburgn/karma-firefox-launcher/compare/v2.1.1...v2.1.2) (2021-11-02) ### Bug Fixes * launcher does not kill firefox.exe on WSL ([395... — committed to jginsburgn/karma-firefox-launcher by semantic-release-bot 3 years ago
- chore(release): 2.1.2 [skip ci] ## [2.1.2](https://github.com/jginsburgn/karma-firefox-launcher/compare/v2.1.1...v2.1.2) (2021-11-02) ### Bug Fixes * launcher does not kill firefox.exe on WSL ([395... — committed to jginsburgn/karma-firefox-launcher by semantic-release-bot 3 years ago
- chore(release): 2.1.2 [skip ci] ## [2.1.2](https://github.com/jginsburgn/karma-firefox-launcher/compare/v2.1.1...v2.1.2) (2021-11-02) ### Bug Fixes * launcher does not kill firefox.exe on WSL ([395... — committed to jginsburgn/karma-firefox-launcher by semantic-release-bot 3 years ago
- chore(release): 2.1.2 [skip ci] ## [2.1.2](https://github.com/jginsburgn/karma-firefox-launcher/compare/v2.1.1...v2.1.2) (2021-11-02) ### Bug Fixes * launcher does not kill firefox.exe on WSL ([395... — committed to jginsburgn/karma-firefox-launcher by semantic-release-bot 3 years ago
- chore(release): 2.1.2 [skip ci] ## [2.1.2](https://github.com/jginsburgn/karma-firefox-launcher/compare/v2.1.1...v2.1.2) (2021-11-02) ### Bug Fixes * launcher does not kill firefox.exe on WSL ([395... — committed to jginsburgn/karma-firefox-launcher by semantic-release-bot 3 years ago
- chore(release): 2.1.2 [skip ci] ## [2.1.2](https://github.com/karma-runner/karma-firefox-launcher/compare/v2.1.1...v2.1.2) (2021-11-02) ### Bug Fixes * launcher does not kill firefox.exe on WSL ([3... — committed to karma-runner/karma-firefox-launcher by semantic-release-bot 3 years ago
- chore(deps): update dependency karma-firefox-launcher to v2 (#185) [](https://renovatebot.com) This PR contains the following update... — committed to openedx/edx-ui-toolkit by renovate[bot] a year ago
@dotnetCarpenter It looks like the fix for this is finally released!
Switching to Nightly (70.0) I can reproduce the problem and the changes in the
kill-browser-processbranch seem to fix it for me. If someone else can confirm that would be helpful.I suspect what was happening with 69 is I triggered an error condition where the launcher process was disabled.
Unfortunately I still don’t have a good idea how to fix WSL.
Spoke to Mozilla folks. We can use
MOZ_DEBUG_BROWSER_PAUSE=0to get the launcher process to dump the child process ID to stderr and then read it back. See: https://wiki.mozilla.org/Platform/Integration/InjectEject/Launcher_Process/It will produce output such as:
However, I can’t seem to get this to work when calling from WSL. Even using
WSLENVto ensure the environment variable gets shared, I can’t read back stderr.[Windows 10] Managed to workaround this issue with the following :
Results :