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

test: Fixes test-tick-processor to not hang on Windows #7628

Closed
wants to merge 5 commits into from
Closed

test: Fixes test-tick-processor to not hang on Windows #7628

wants to merge 5 commits into from

Conversation

JoeDoyle23
Copy link
Member

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
Affected core subsystem(s)

This adjusts the parallel/test-tick-processor test so that it doesn't hang on Windows when run during stress testing (#4427)

Description of change

The change was to not use fs.execFileSync and instead just use fs.execSync after wiring the test code to a file. I ran the adjusted test on Windows 10 x64 and Windows Server 2012 R2 doing 3000 iterations on each OS.

** I have no idea why this fixes the hanging issue **

cc: @Trott

@nodejs-github-bot nodejs-github-bot added the test Issues and PRs related to the tests. label Jul 9, 2016
@mscdex mscdex added the windows Issues and PRs related to the Windows platform. label Jul 9, 2016
@@ -57,4 +60,5 @@ function runTest(pattern, code) {
{encoding: 'utf8'});
assert(pattern.test(out));
fs.unlinkSync(log);
}
fs.unlinkSync(testCodePath);
}
Copy link
Member

Choose a reason for hiding this comment

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

Missing line feed at the end of the file should result in a lint error if you run make jslint or make test.

Copy link
Member Author

Choose a reason for hiding this comment

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

Or vcbuild jslint for us Windows folks :)

@@ -18,7 +19,7 @@ common.refreshTmpDir();
process.chdir(common.tmpDir);
// Unknown checked for to prevent flakiness, if pattern is not found,
// then a large number of unknown ticks should be present
runTest(/LazyCompile.*\[eval\]:1|.*% UNKNOWN/,
runTest(/LazyCompile.*test.js:1|.*% UNKNOWN/,

Choose a reason for hiding this comment

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

This test is designed to test the names of profiled functions appear in profiler output (as an approximation to profiler correctness). eval was used before since eval should appear on the stack every time it is observed by the profiler making it most likely to appear in the output. If the script below is now longer eval'd, we'll have to look for another symbol. f is too generic so maybe the function below could be renamed to something unique that the output could be checked for.

Copy link
Member

Choose a reason for hiding this comment

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

Urgh, so maybe the reason this makes it reliable is because the name of the file is always going to be there. I guess we'll see when the change is made.

Regardless, might be a good idea to preserve all this information-sharing in a comment or seven in the file.

Copy link
Member Author

Choose a reason for hiding this comment

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

In testing this, the file name appears in the same place that [eval] did in the original test's output, which I why I replaced it that way. It's not a big deal to make the function name more meaningful and then to adjust the regex if we think that's more declarative.

@@ -59,6 +64,6 @@ function runTest(pattern, code) {
' --prof-process --call-graph-size=10 ' + log,
{encoding: 'utf8'});
assert(pattern.test(out));
fs.unlinkSync(log);
//fs.unlinkSync(log);
fs.unlinkSync(testCodePath);
Copy link
Member

Choose a reason for hiding this comment

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

I might have mis-commented before but this is backwards. The log file needs to be removed. The file in the tmp dir (testCodePath) does not. (The tmp directory is cleared by each test that needs it before it is used.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I misread it. Fixed.

@matthewloring
Copy link

This looks good on my end if the flakiness is still gone with the latest changes (checking for function name instead of file name). I would expect the file name to appear somewhere in the output unconditionally so it would be worth reverifying.

@Fishrock123
Copy link
Contributor

@@ -60,7 +60,7 @@ rules:
indent: [2, 2, {SwitchCase: 1}]
key-spacing: [2, {mode: "minimum"}]
keyword-spacing: 2
linebreak-style: [2, "unix"]
# linebreak-style: [2, "unix"]
Copy link
Member

Choose a reason for hiding this comment

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

This change should be removed from the change set, no?

@Trott
Copy link
Member

Trott commented Jul 10, 2016

Failed in CI: https://ci.nodejs.org/job/node-test-binary-arm/2796/RUN_SUBSET=6,label=pi1-raspbian-wheezy/console

I don't think this change is going to make the test not flaky, unfortunately. Although if your understanding of the situation has increased and you have other ideas to try, please do!

@Trott
Copy link
Member

Trott commented Sep 23, 2016

Closing as test-tick-processor has been broken into three different test files now and remaining flakiness is being explored in #8725. (Re-open or comment if you think this shouldn't be closed.)

@Trott Trott closed this Sep 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test Issues and PRs related to the tests. windows Issues and PRs related to the Windows platform.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants