nodejs-datastore: v4 doesn't release resource

Thanks for stopping by to let us know something could be better!

The library does not release a resource and the unit tests don’t exist. Is there a new command that we have to call before exiting from the application?

Environment details

  • OS: Mac, Linux, Windows
  • Node.js version: latest of 8, 10, 11
  • npm version: provided by node
  • @google-cloud/datastore version: 4.0.0

Steps to reproduce

  1. $ docker pull google/cloud-sdk:latest
  2. $ git clone https://github.com/ert78gb/google-datastore-emulator.git
  3. $ cd google-datastore-emulator
  4. $ npm i
  5. $ npm install --no-save @google-cloud/datastore
  6. $ npm test

All test is pass, but mocha does not exists. The reason is there is a resource, timer, promise that running in the background and mocha waiting for the exit.

The 3.1.2 version of the lib worked perfectly, but something changed. You can see it in the travis build logs https://travis-ci.org/ert78gb/google-datastore-emulator/builds

I don’t want to use process.exit() at the end of the test, because it hides resource release problems and it is also not a good practice.

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (10 by maintainers)

Most upvoted comments

I will create a very simple example tomorrow. The script will

  • connect to the bucket
  • and add a document

The script will not exist. I am experiencing the same problem with the latest pupsub lib. I think one of the common components causes the problem. My guess is there is a timer to keep alive the connection or renew a token periodically.