-
Notifications
You must be signed in to change notification settings - Fork 674
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 TestCafe stability and performance in concurrency mode under heavy load #3103
Comments
Unfortunately, I can't reproduce this behavior. Could you please provide a HAR report or record a screencast of your test session? Judging by the description, the problem can be caused by Chrome's background tabs throttling feature. When Chrome suspends a background tab, it can't respond to the TestCafe server and thus can't execute any test command. Try to specify the
and manually focus each Chrome window when it is opened. |
Hi @AndreyBelym , Thank you so much for your response. I don't think the Chrome background tabs throttling feature is the issue, because I tried the tests in concurrency with Firefox and was getting the same problems. What's strange is that concurrency works if testing is simple. I tried to run concurrency with just one test file and it worked fine. This made me think that maybe the problem was happening when I ran concurrency on multiple tests that were multiple folders This inspired me to reproduce the problem in a demoable repo (there is a link below), which I made by copying and pasting multiple instances of the TestCafe example tests in reptitive files and folders. Everything was still working fine at that point. At this point I wanted to make these fake tests more like my real ones by adding Roles and testcafe-vue-selectors because I thought the problem might be coming from there. I added two roles which almost caused the problem, because the test statuses only updated after everything was finished, but the tests still finished and closed at the end. However once I added a test-cafe-vue-selector it produced the same problem that I've been having. Essentially all the tests run, but the status of the first and second tests are the only ones that appear in the console. After all the tests run, the concurrent instances become infinitely idle and never close. I am running 4 concurrent instances by-the-way So I think the problem is with the latest version of TestCafe (0.23.1) and testcafe-vue-selectors. I pushed up the code to my GitHub, https://github.com/dbschwartz/test-cafe-error-demo. Please clone the repo and run npm test to reproduce. Let me know if there is anything else I can do to clarify. I love TestCafe and all that you guys do. Thanks for making such an awesome product. -Dave |
Thank you for your feedback! I've found that your example works fine with the |
My pleasure! What's interesting here though is if you run these tests with Test Cafe v 0.22.0, everything finishes. This repo illustrates problems with my current tests because they run concurrently in v 0.22.0 with I made another repo with everything being same except using Test Cafe v 0.22.0 that runs in a stable state with 4 concurrent instances if you'd like to check it out: https://github.com/dbschwartz/test-cafe-error-demo-stable Note the test statuses take about 45 seconds before they start updating, but they eventually do and everything finishes and closes as normal. My guess is that maybe there was some new server code introduced that might have lent itself to this. Perhaps it's related to handling the unhandled promise rejection errors that were happening in concurrency before. Again just a guess. When I have use concurrency in other applications, its usually recommended to somewhat match instances with the number of cores on the machine, maybe using one less, i.e. If there are 7 cores, use 6 instances, etc.. I have been testing on machines with more than 4 processors. Should Test Cafe be run fairly conservatively with concurrency? Thank you so much for all your help! |
Apologies if you recently cloned the repo, my changes weren't pushed till now. The other abnormal thing I realized is that with v 0.23.1 it seems only 2 of the concurrent instances are actually being used during the test execution. The other 2 just seem to be idle on the Test Cafe example page for most of the test run without any actions, commands, assertions being run. Granted this isn't the ideal scenario, but still strange none-the-less. This does not happen in v 0.22.0 Also correction above, the test statuses when run in TestCafe v0.22.0 take about 45 seconds to a minute to update |
Also, after I run concurrency with This is just a warning, but might concern some users. Maybe those who use concurrency should increase their max listeners in Node. |
@AndreyBelym @miherlosev |
I tried to reproduce the problem with |
Yes!! I tried it! Looks great!! Only thing I might want to add is these two tests seem to be failing randomly in some runs and passing in others. They fail on testcafe |
@dbschwartz, it seems that the bug is caused by using a role in the test: https://github.com/dbschwartz/test-cafe-error-demo-stable/blob/master/tests/testsCafeExamples1/test3.js#L7. I've created separate ticket #3232 about this issue. |
This issue has been automatically marked as stale because it has not had any activity for a long period. It will be closed and archived if no further activity occurs. However, we may return to this issue in the future. If it still affects you or you have any additional information regarding it, please leave a comment and we will keep it open. |
We're closing this issue after a prolonged period of inactivity. If it still affects you, please create a new issue with up-to-date information. Thank you. |
What is your Test Scenario?
Running tests in concurrency in Windows 10 and Node 6.10.3 with TestCafe 0.23.1
What is the Current behavior?
The tests start to run normally, but the status for the first test is the only one that shows in the command prompt. Eventually the browsers either show the TestCafe start page or are on the start pageURL and are just awaiting further commands from hammerhead. They just stay this way until I abort by pressing CTRL + C.
What is the Expected behavior?
Concurrent tests should just as they did in TestCafe 0.22.0
What is your web application and your TestCafe test code?
I can't put the actual tests on here but I could probably make a sample eventually. I'm afraid though that the problem is possibly Node v6.10.3 or maybe Windows 10
Your website URL (or attach your complete example):
Your complete test code (or attach your test files):
Your complete test report:
Screenshots:
Steps to Reproduce:
Your Environment details:
The text was updated successfully, but these errors were encountered: