-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Tests fail on Windows #4370
Comments
@addisonElliott nice breakdown, thanks for digging into this! I've seen this rarely in our local/CI tests, enough that we haven't emphasized on it. I'll get back to you with a more detailed response later, but just wanted to say I think ultimately adding at least one run in our CI using appveyor would help a ton in catching and fixing windows specific issues. I've used it personally and it's free for OSS so we wouldn't have to do too much to get that in here. We have used this in the past for the .NET SDK on top of that. |
So to second what I was saying before I think it would be fantastic if we add appveyor into our CI. @flovilmart if you can hookup appveyor on your end and setup a team I would be willing to put up a PR with the .travis.yml for starters. |
@montymxb I'm not familiar with appveyor myself. I'm having trouble understanding how appveyor will prevent these issues happening with running |
I believe we could run in a windows environment on appVeyor. Also, this is a server project aimed to be deployed on Linux/ Mac/Unix environments, having a proper développement environment for windows is very nice to have, did you try with WLS, and proper bash instead of Cygwin? I’m not familiar with windows, so I can’t really talk about overhead or such setting up this way, but I could explore in a VM probably. I’m genuinely curious about it .) |
I got WSL downloaded and nodejs installed. It all worked fine, there were 3 errors and 9 pending but I think that is the same results I got on my Debian VPS. @flovilmart I entirely agree that it would be great if WSL was widely adopted by Windows users, but it's going to take some time. I still think the industry standard is Cygwin. In my opinion, I think we should attempt to support Cygwin/Windows setups now. WSL is only available if you have Windows 10 Anniversary Update or higher. I think this is a small subset of Windows users for now. Given a few years, I think WSL may be more widely adopted and in the future these problems may be a thing of the past.
|
This is ok, those tests have some issues when run on local machines, we need to investigate |
@addisonElliott appveyor provides a windows environment whereas Travis CI cannot. Having tests on windows as part of our CI would help ensure that, once we correct window related issues, we don't reintroduce them later. Better than someone finding and reporting problems when they try to run on windows themselves, kind of what it is now 😛. |
Just wanted to say I've come across some SO posts like this one that suggest, in certain cases, there can a significant performance loss to node.js when running on windows. I think we'll still work through it, but just something to keep in mind. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
FYI Still looking into this for now. I have an idea why it might be slower on Windows and I think that it is because of is-mongodb-running module taking a long time due to the ps module in NodeJS. Here is the issue I'm referencing: This is on my radar and I'm hoping to further my investigation. (Also, I've tried WSL but there is some limitations with running tests on it because netstat/lsof is not fully implemented and that is what some of the mongodb modules use to determine if a process is running) |
While working on #4373 I ran into the same issue on macOS using parse-server v2.7.1 In my case during most test cases, the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Issue Description
Under Windows, when running the test suite for parse-server, many of the tests will fail with the following error message:
However, running the exact same test suite under Linux (in my case, I tried it on Debian amd64), the tests pass fine.
When running all of the tests, about 60% of them will fail with this error message. I'll explain my theory why below but this is not a small issue by any means.
Steps to reproduce
npm install
in the directory.npm run test:win
for Windows and the errors should appear.npm run test
ornpm test
/Expected Results
This error message occurs with many files so I just picked one test file where this occurred and debugged that. The first test file ran is
AccountLockoutPolicy.spec.js
and the very first testaccount should not be locked even after failed login attempts if account lockout policy is not set
fails on Windows.For either Linux or Windows, the expectation is for the tests to pass. Here is the output for Linux when testing just the
AccountLockoutPolicy.spec.js
test file. Note that I stop it halfway through because I am focusing on that first test.On Windows, here is the result running the tests on the same file:
What I think the issue is
When digging into the code to diagnose this issue, I started with the error message and what it indicates. In
spec/helper.js
, lines 198-201 are the following:So there is an array of open connections and if that is not empty at the end of the test, then something is still running or having issues. So, the next step was I found where openConnections was changed. Lines 143-150 in the same helper file are:
If you take a look at the logs given above, for Linux the connection is opened and closed almost immediately which is what you expect for HTTP requests. However, Windows has a bit of a lag and this is what causes the error. When the open connections are checked, there is still an open connection because it has not been closed yet.
Sample test case
I was not sure if the error was related to Parse or a bug in XMLHttpRequest so I created a test script to determine if the same thing occurs with XMLHttpRequest.
Here is my test script where the same issue still occurs:
On Linux, the connection is opened and closed almost instantly but there is a lag once again in Windows.
Solution
What would be the best way to solve this? We could put a delay in checking the open connections for Windows? Or is there another solution I am missing?
Environment Setup
The text was updated successfully, but these errors were encountered: