-
Notifications
You must be signed in to change notification settings - Fork 161
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: framework fails to shutdown gracefully when exit code is a string #545
Conversation
🤖 I detect that the PR title and the commit message differ and there's only one commit. To use the PR title for the commit history, you can use Github's automerge feature with squashing, or use -- conventional-commit-lint bot |
9e7a788
to
a225134
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any testing for this?
No testing at the moment, it's unclear how we should approach testing this (beyond local exploratory testing). We don't have process lifecycle tests specific to node.js and mocha doesn't support this type of test. I think we could possibly try to add a test that simulates emitting the event, I'm also fine with relying on exploratory tests and our conformance test coverage which should be exercising the full process lifecycle. WDYT? |
a225134
to
9384474
Compare
Despite the Node.js docs indicating that the exit code should always be a number it seems this is unchecked and, in fact,
process.exit
may be called with a string value.Verified experimentally:
Some Cloud Function users report errors on shutdown when either their code or a dependency calls process.exit with a string value. To account for this the exit code check is updated to use string comparison to account for the possibility of a string exit code.