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

Run tests against VS Code as node process #50434

Closed
wants to merge 6 commits into from

Conversation

jakebailey
Copy link
Member

@jakebailey jakebailey commented Aug 24, 2022

This is a goofy idea I thought of in #50382 (comment); VS Code runs typescript via ELECTRON_RUN_IN_NODE; with some trickery, we can create a shim which calls VS Code and pretends to be node.

This way, we can (hopefully) be told if we introduce a problem that only affects our use in electron's node, e.g. if pointer compression is enabled and we overflow an integer or something.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Aug 24, 2022
@@ -66,6 +66,11 @@ async function exec(cmd, args, options = {}) {
}
exports.exec = exec;

async function execNode(args, options = {}) {
return exec(process.execPath, [...process.execArgv, ...args], options);
Copy link
Member Author

Choose a reason for hiding this comment

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

Normally, you'd use fork to do this, but we have our own custom helper to run external programs, so to fix the fact that we don't pass execArgv down, I added another.

(In a perfect world, I'd just get rid of this and use execa.)

This comment was marked as spam.

scripts/build/utils.js Outdated Show resolved Hide resolved
@jakebailey jakebailey marked this pull request as ready for review August 24, 2022 22:09
@jakebailey
Copy link
Member Author

jakebailey commented Aug 24, 2022

However, there is some good news; testing locally, 1 << n works up to 31, which is more than we expected (we previously thought 29).

@@ -0,0 +1,5 @@
const flag = "--ms-enable-electron-run-as-node";
Copy link
Member Author

Choose a reason for hiding this comment

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

VS Code requiring this flag really screws with things, hence this terrible hook.

@DanielRosenwasser
Copy link
Member

In theory you want to run the this in the full perf suite - not as much in CI, right?

@jakebailey
Copy link
Member Author

What would we be testing for VS Code? Performance or totally breaking? I was expecting the latter because flags would start overflowing and tests would fail.

@DanielRosenwasser
Copy link
Member

I was expecting the latter because flags would start overflowing and tests would fail.

So a conforming implementation will guarantee the 32-bit semantics continue to work - I believe there's no "implementation-defined" behavior on numbers in this regard. The problem is more about the performance breakdown from automatic boxing and the associated deoptimizations once you go past the SMI upper limit.

@sandersn sandersn added this to Not started in PR Backlog Sep 2, 2022
@sandersn sandersn moved this from Not started to Waiting on author in PR Backlog Sep 13, 2022
@jakebailey jakebailey closed this Oct 1, 2022
PR Backlog automation moved this from Waiting on author to Done Oct 1, 2022
@jakebailey jakebailey deleted the ci-test-electron branch October 20, 2022 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
PR Backlog
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants