test: add test for effect of UV_THREADPOOL_SIZE#49165
Merged
nodejs-github-bot merged 1 commit intonodejs:mainfrom Aug 16, 2023
Merged
test: add test for effect of UV_THREADPOOL_SIZE#49165nodejs-github-bot merged 1 commit intonodejs:mainfrom
nodejs-github-bot merged 1 commit intonodejs:mainfrom
Conversation
Collaborator
|
Review requested:
|
11 tasks
This (not particularly elegant) native addon tests the effect of UV_THREADPOOL_SIZE on node-api. The test fails if Node.js allows more than UV_THREADPOOL_SIZE async tasks to run concurrently, or if it limits the number of concurrent async tasks to anything less than UV_THREADPOOL_SIZE.
25ac64c to
c8edfb7
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Collaborator
Member
|
cc @nodejs/cpp-reviewers @nodejs/libuv |
Collaborator
Member
|
This works perfectly. I've tested it with the |
22 tasks
24 tasks
Collaborator
|
Landed in 556e95a |
26 tasks
32 tasks
UlisesGascon
pushed a commit
that referenced
this pull request
Sep 10, 2023
This (not particularly elegant) native addon tests the effect of UV_THREADPOOL_SIZE on node-api. The test fails if Node.js allows more than UV_THREADPOOL_SIZE async tasks to run concurrently, or if it limits the number of concurrent async tasks to anything less than UV_THREADPOOL_SIZE. PR-URL: #49165 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This (not particularly elegant) native addon tests the effect of
UV_THREADPOOL_SIZEon node-api. The test fails if Node.js allows more thanUV_THREADPOOL_SIZEasync tasks to run concurrently, or if it limits the number of concurrent async tasks to anything less thanUV_THREADPOOL_SIZE.The test schedules
UV_THREADPOOL_SIZE + 1async tasks and waits untilUV_THREADPOOL_SIZEtasks are running concurrently. (If this never happens, the test times out.) AllUV_THREADPOOL_SIZEtasks then wait for a second to see if the last task also starts running concurrently, which should not happen.Admittedly, I hastily put this together and the code is sloppy. While having this test is good in any case, the main motivation is such that @anonrig can invoke the test from his own test in #48890.