{{ message }}
Exit gracefully on linux#12139
Merged
Merged
Conversation
Singleton now sends the "we've started" message out only after it's received a `'ready'` event from `app`. Previously it sent the message out immediately, resulting in the parent test trying to manipulate it before Singleton's event loop was fully bootstrapped.
Rewrite the "exits gracefully on macos" spec to run on Linux too.
In the 'exits gracefully' test for app.exit(exitCode), print the relevant error information if the test fails.
codebytere
approved these changes
Mar 6, 2018
Member
Windows does not support sending signals, but Node.js offers some emulation with process.kill(), and subprocess.kill(). Sending signal 0 can be used to test for the existence of a process. Sending SIGINT, SIGTERM, and SIGKILL cause the unconditional termination of the target process. So, we'll need a different approach if we want to test this in win32.
Member
Author
|
@codebytere, thank you for doing the win32 research on this! I agree we'll need a different approach for win32. Simulating SIGTERM is a good Node feature, but forcing an unconditional exit doesn't give us a meaningful test when we're looking for a graceful shutdown. So let's limit this implementation of the test to macOS and Linux. |
Member
|
in that case, i'll merge when CI goes ✅✨ |
Contributor
|
I would vote for backporting the change to |
codebytere
pushed a commit
that referenced
this pull request
Mar 7, 2018
* Fix timing issue in singleton fixture. Singleton now sends the "we've started" message out only after it's received a `'ready'` event from `app`. Previously it sent the message out immediately, resulting in the parent test trying to manipulate it before Singleton's event loop was fully bootstrapped. * Check for graceful exits on Linux, too. Rewrite the "exits gracefully on macos" spec to run on Linux too. * Check for graceful exits everywhere. * Tweak comment * Better error logging in api-app-spec.js. (#12122) In the 'exits gracefully' test for app.exit(exitCode), print the relevant error information if the test fails. * Run the exit-gracefully test on macOS and Linux. Windows does not support sending signals, but Node.js offers some emulation with process.kill(), and subprocess.kill(). Sending signal 0 can be used to test for the existence of a process. Sending SIGINT, SIGTERM, and SIGKILL cause the unconditional termination of the target process. So, we'll need a different approach if we want to test this in win32.
Member
sethlu
pushed a commit
to sethlu/electron
that referenced
this pull request
May 3, 2018
* Fix timing issue in singleton fixture. Singleton now sends the "we've started" message out only after it's received a `'ready'` event from `app`. Previously it sent the message out immediately, resulting in the parent test trying to manipulate it before Singleton's event loop was fully bootstrapped. * Check for graceful exits on Linux, too. Rewrite the "exits gracefully on macos" spec to run on Linux too. * Check for graceful exits everywhere. * Tweak comment * Better error logging in api-app-spec.js. (electron#12122) In the 'exits gracefully' test for app.exit(exitCode), print the relevant error information if the test fails. * Run the exit-gracefully test on macOS and Linux. Windows does not support sending signals, but Node.js offers some emulation with process.kill(), and subprocess.kill(). Sending signal 0 can be used to test for the existence of a process. Sending SIGINT, SIGTERM, and SIGKILL cause the unconditional termination of the target process. So, we'll need a different approach if we want to test this in win32.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes not ok 11 app module app.exit(exitCode) exits gracefully on macos #12050 which was caused by a timing issue. The singleton fixture was reporting its readiness before app had emitted a 'ready' signal. At times, this could cause the parent test harness to run its tests before the child Electron process had finished starting its event loop.
Rewrites the
exit_gracefully_on_macos()test to run on other platforms too.This code is ready for review but is a WIP in the sense that I need confirmation from CI about the portability of the rewritten test.