Skip to content
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

Deprecation warnings in unit tests related with MongoDB #161

Open
fgalan opened this issue Nov 12, 2018 · 0 comments
Open

Deprecation warnings in unit tests related with MongoDB #161

fgalan opened this issue Nov 12, 2018 · 0 comments
Labels

Comments

@fgalan
Copy link
Member

fgalan commented Nov 12, 2018

Unit test run is showing a log like this (just a fragment):

  Configuration cache
    When an IoT Agent sends a registration with configurations
(node:5571) UnhandledPromiseRejectionWarning: MongoError: topology was destroyed
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/db.js:918:78
    at handleCallback (/home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/utils.js:120:56)
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/db.js:316:5
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)
(node:5571) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5571) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
      ✓ should store the configurations in MongoDB (104ms)
    When an IoT Agent updates the registration information with different configurations
(node:5571) UnhandledPromiseRejectionWarning: MongoError: topology was destroyed
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/db.js:918:78
    at handleCallback (/home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/utils.js:120:56)
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/db.js:316:5
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)
(node:5571) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:5571) UnhandledPromiseRejectionWarning: MongoError: topology was destroyed
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/db.js:918:78
    at handleCallback (/home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/utils.js:120:56)
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/lib/db.js:316:5
    at /home/travis/build/telefonicaid/iotagent-manager/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:469:18
    at _combinedTickCallback (internal/process/next_tick.js:132:7)
    at process._tickDomainCallback (internal/process/next_tick.js:219:9)
(node:5571) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
      ✓ should remove the older information (53ms)

Not sure about the cause of this problem... It may be related with some flaw in the DB connection logic.

The code should be reviewed and eventually fixed. Although the warning it at unit test it may hide some kind of bug with impact in real usage condition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant