-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[WIP] Detect if NODE_OPTIONS are present in binary; if not, respawn #5492
Conversation
Thanks for the contribution! Below are some guidelines Cypress uses when doing PR reviews.
PR Review ChecklistIf any of the following requirements can't be met, leave a comment in the review selecting 'Request changes', otherwise 'Approve'. User Experience
Functionality
Maintainability
Quality
Internal
|
Co-authored-by: Andrew Smith <andrew@andrew.codes>
…press-io/cypress into node-options-and-no-sandbox-in-binary
packages/server/index.js
Outdated
if (!nodeOptions.maybeFork()) { | ||
nodeOptions.reset() | ||
|
||
module.exports = require('./lib/cypress').start(process.argv) | ||
} |
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.
I would separate out the methods that return whether the fork is needed from the fork itself - and reverse the if
condition to only do that when the fork is necessary (since that's the rare, minority case).
As it's written - the logic implies the opposite (that this is the majority). I would also separate out the mutation and make the check pure and idempotent.
// if our parent process was launched without the correct
// NODE_OPTIONS environment variable then fork a new child
// process with the fixed options
if (nodeOptions.needsFork()) {
return nodeOptions.forkWithCorrectOptions()
}
// otherwise preserve the original options
nodeOptions.preserveOriginalOptions()
module.exports = require('./lib/cypress').start(process.argv)
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.
It's reversed because we can't return here since it's not a function, so for Cypress not to start, it needs to be in some kind of control structure. I can make it an if/else, but I think those are frowned upon in this project, so I'll just make a launch
function.
This is now blocked, there appears to be no way to set |
Going to work around this in #5525 for now. |
…cookie-parse-error See #5492 for original review and discussion
User facing changelog
N/A
Additional details
--no-sandbox
at boot timeconsole.log
s, and doingelectron test.js
, and it doesn't even get to theconsole.log
before erroring about--no-sandbox
.How has the user experience changed?
N/A
PR Tasks