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
improve testing compatibility with Node.js #5204
Conversation
@kzc this should address #5202 (comment) − if you don't mind give it a spin on your OS since mine are all done on Windows 😉 |
With this PR:
|
So Unicode parsing is broken on macOS somehow? 😓
Given the fact that (you can use Oh wait I know what might have happened − you may have cropped the |
Okay this is starting to feel creepy... $ uname -a
Darwin MBP.local 15.6.0 Darwin Kernel Version 15.6.0: Thu Jun 21 20:07:40 PDT 2018; root:xnu-3248.73.11~1/RELEASE_X86_64 x86_64 $ node -v
v4.2.1 $ node test/compress unicode.js
--- unicode.js
Running test [ascii_only_false]
Running test [ascii_only_true]
Running test [unicode_parse_variables]
Running test [unicode_escaped_identifier_1]
Running test [unicode_escaped_identifier_2]
Running test [unicode_identifier_ascii_only]
Running test [unicode_string_literals]
Running test [check_escape_style]
Running test [escape_non_escaped_identifier]
Running test [non_escape_2_non_escape]
Running test [issue_2242_1]
Running test [issue_2242_2]
Running test [issue_2242_3]
Running test [issue_2242_4]
Running test [issue_2569]
Running test [surrogate_pair]
Running test [surrogate_pair_ascii] i.e. can't reproduce those |
With the following patch: --- a/test/sandbox.js
+++ b/test/sandbox.js
@@ -248,16 +248,23 @@ function run_code_vm(code, toplevel, timeout) {
process.stdout.write = function(chunk) {
stdout += chunk;
};
+console.error('====RUN====');
+console.error(code);
+console.error('-----------');
try {
var ctx = vm.createContext({ console: console });
// for Node.js v6
vm.runInContext(setup_code, ctx);
vm.runInContext(toplevel ? "(function(){" + code + "})();" : code, ctx, { timeout: timeout });
// for Node.js v4
+console.error('DONE', stdout);
+console.error('===========');
return strip_color_codes(stdout.replace(/\b(Array \[|Object {)/g, function(match) {
return match.slice(-1);
}));
} catch (ex) {
+console.error('THROWN', ex);
+console.error('====!!!====');
return ex;
} finally {
process.stdout.write = original_write; Running
In my case running identical inputs twice through |
In all of Why it only happens on your copy of macOS though remains a mystery 😓 |
I'm running an old version of macos, Darwin 13.4.0 x86_64, so that could be the problem. But then again, all unicode tests run fine on node v6.x through v16.x. Maybe that version of NodeJS relied on a system library and the subsequent releases had unicode built in?
node-v8.0.0 hard crashes on issue_4974 every single time on my machine. But now that I look at that test, it infinitely recurses:
Granted, it shouldn't outright crash out of node-v8.0.0, but it does politely exhaust the stack in subsequent major Node releases. Was that the intention of the test? In any case, I wouldn't lose sleep over these failing tests on old node versions. You could bump the versions of those tests to the next major to avoid the flakes on my machine if you want. |
So the only remaining issue is with I do recall Node.js team were quibbling about ICU back in the days, so it's likely that they didn't statically linked to one that provides the appropriate Unicode version and just rely on whatever's available. Problem is I can't reproduce this locally, so even if I were to workaround this by bumping |
Node v4.x was not a great series. It's admirable that you're still supporting it, but I wonder if anyone is using it. |
No description provided.