#I'd like to find out how many workers are being used during e2e test
7 messages · Page 1 of 1 (latest)
I want to know if each app.getRequest() uses the same worker(PC core) or not. And also do all 500 requests concurrently be sent per 1 second?
What do you mean "all available workers"? JavaScript always runs on a single thread, but calls to Node API can run in parallel while a promise is resolving. So in your case, 500 requests would be sent one after each other, since it's javascript that call the http api, then the waiting logic is implemented in Node internals and the results will be handed to JavaScript once the response comes.
So, for javascript execution, only one thread is ever used in your scenario.
@little radish thanks for your response. So how can I do those 500 requests consurrently in the test?
If I change it to run the same case 500 times instead of doing all the request inside one test case - would that be done concurrently?
Don't get me wrong - the requests will be sent one after another, but due to how promises work, they will be handled concurrently - menaing sending another request will not wait until the response is received. Just all the work will be done on kne thread.