-
Notifications
You must be signed in to change notification settings - Fork 7
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
get-port not working #2
Comments
Get-port is working. There need additional checks, cause yarn runs tests in parallel. When you obtain free port mongod needs some time for startup, at this time starts another mongod process on same port which throws error. You may try https://github.com/nodkz/mongodb-memory-server i spent quite huge amount of time to make it stable working with parallel testing. |
The first time it runs it tries port 27017 which was taken before the tests even started. That's what's making me think |
Hey! Thanks for reporting this. If it's trying port 27017 and MongoDB is constantly running before the tests then the issue is likely with get-port not detecting the port in use. This was an early issue for me when developing the package but wasn't an issue later on in its use and development, so I believed it was just a temporary issue at the time. If you find out exactly where this is occurring feel free to submit a PR or let me know and I can fix. |
Looks like Added this to const getPort = require('get-port');
getPort(27017).then(console.log); Then ran this and even though mongo is using docker run -p 27017:27017 mongodb
node x.js |
When using this if I have mongodb running on port 27017 it still tries binding to that port instead of trying another open port.
For example when using ava with
MongoDBServer.debug = true;
.The text was updated successfully, but these errors were encountered: