-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Performance issue with preinstall and postinstall scripts #4551
Comments
I think that there is the problem with this timeout yarn/src/util/blocking-queue.js Line 47 in 25890c8
|
@vkrol great find! Would you like to submit a fix? I'd do the following two:
What do you think? Also /cc @arcanis |
@BYK thanks! I will create the fix. Do I need to create some test for it? |
@BYK I found some confusing behavior in Jest. The fake Timer implementation does not have unref method in Node environment so blocking-queue.js test will fail with an error:
I asked a question about this in Discord chat.
|
@vkrol sorry, I couldn't find your message on Discord :( Ping me directly there? I think instead of using fake timers you can make sure the timer gets released in tests then? |
Yeah, Jest doesn't support it at this time. You'll need to guard it for Jest, like |
Sorry for the confusion: I am asked in Jest Discord chat.
Unref is documented in Node.js documentation https://nodejs.org/api/timers.html#timers_timeout_unref
I created the issue in Jest repository jestjs/jest#4559 |
Fake timers already used there yarn/__tests__/util/blocking-queue.js Line 6 in 08411a0
|
TIL. Sorry :)
Then how about we go with @cpojer's suggestion and checking for it? |
@BYK do you think that we need to add the following line of code to the BlockingQueue implementation?
I think that it is somewhat hacky, but if you approve this, then ok :) |
It should be |
Yes, sure. Sorry.
Thanks. I will do it. |
…cripts (#4588) **Summary** Fixes #4551. See #4551 (comment) **Test plan** * Existing tests pass * Manually tested
…cripts (yarnpkg#4588) **Summary** Fixes yarnpkg#4551. See yarnpkg#4551 (comment) **Test plan** * Existing tests pass * Manually tested
Do you want to request a feature or report a bug?
Bug.
What is the current behavior?
If the current behavior is a bug, please provide the steps to reproduce.
Create the following package.json:
Run
Measure-Command { yarn }
in PowerShell:If the package.json does not contain preinstall OR postinstall script then the duration will be:
What is the expected behavior?
I do not understand why the
yarn
takes so much time if both scripts are present.Please mention your node.js, yarn and operating system version.
Node.js 8.5.0
Yarn 1.1.0
OS Windows 10
The text was updated successfully, but these errors were encountered: