Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Detect and kill browser process when launcher process is being used #103

Merged
merged 3 commits into from Aug 9, 2019

Conversation

birtles
Copy link
Collaborator

@birtles birtles commented Aug 9, 2019

Fixes #101.

@birtles birtles merged commit c1a3939 into master Aug 9, 2019
@birtles birtles deleted the kill-browser-process branch August 9, 2019 05:41
@BrennanConroy
Copy link

BrennanConroy commented Jan 17, 2020

I'm unable to use this package after this change.
I'm getting: TypeError: this.on is not a function

Changing this to:

process.on('exit', function () {
  if (browserProcessPid) {
    try {
      process.kill(browserProcessPid)
    } catch (e) {
  }
})

fixes it locally.

@birtles
Copy link
Collaborator Author

birtles commented Jan 18, 2020

Oh, I'm not sure what's going on there. I don't recall how this all fits together, but I thought it should define the on method here and it worked for me previously.

I'd like to understand what changed or what is going wrong. I don't suppose you're using a more recent version of karma than 4.2.0, for example?

@BrennanConroy
Copy link

I'm using karma 3.1.4 and tried 4.4.1, both had the same issue.

@BrennanConroy
Copy link

this.on is valid inside the _start function, but not valid outside of that function. No idea why, but would it be possible to modify this and release a new version?

@johnjbarton
Copy link
Contributor

@BrennanConroy Please open an issue with steps to reproduce your problem.

@BrennanConroy
Copy link

Figured it out. We have some code to check if the browser exists before putting it in the karma config, and instead of using FirefoxHeadlessBrowser.prototype we were creating an instance and passing an empty function for the base launcher. Sorry for the false alarm 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Launcher doesn't kill Firefox 68
3 participants