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: killing subprocess only if prism is running in multiprocess mode #645

Merged
merged 4 commits into from
Sep 24, 2019

Conversation

karol-maciaszek
Copy link
Contributor

Closes #644

Checklist

  • Tests have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

What kind of change does this PR introduce?

Bug fix

What is the current behavior? What is the new behavior?

Cli is trying to kill subprocess even if it is not running in multi-process mode. It results in no nice-looking line ✖ fatal Cannot read property 'kill' of undefined.

This fix moves logging of errors to the place where the context (single/multiprocess) is known. .kill will be invoked only in the latter context.

Does this PR introduce a breaking change?

No

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Contributor

@lag-of-death lag-of-death left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's OK when the changelog is adjusted 👍

@lag-of-death
Copy link
Contributor

hm.. just curious if we could do sth like:

====server====
mock -p 4010
====command====
mock -p 4010

in an e2e test? maybe the change could be tested like this? WDYT @StefanDywersant ?

Copy link
Contributor

@XVincentX XVincentX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments, good to go. I'll leave the merge to you.

CHANGELOG.md Outdated Show resolved Hide resolved
packages/cli/src/util/createServer.ts Show resolved Hide resolved
packages/cli/src/util/createServer.ts Show resolved Hide resolved
packages/cli/src/util/createServer.ts Show resolved Hide resolved
@karol-maciaszek
Copy link
Contributor Author

hm.. just curious if we could do sth like:

====server====
mock -p 4010
====command====
mock -p 4010

in an e2e test? maybe the change could be tested like this? WDYT @StefanDywersant ?

I doubt whether I can match log lines here. I also can't start two prism instances here in order to reproduce the error.

@XVincentX XVincentX merged commit 7476966 into master Sep 24, 2019
@XVincentX XVincentX deleted the fix/cluster-process-kill branch September 24, 2019 12:33
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.

Cannot read property 'kill' of undefined
3 participants