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

Client close #128

Open
NathanHazout opened this issue May 31, 2020 · 2 comments
Open

Client close #128

NathanHazout opened this issue May 31, 2020 · 2 comments

Comments

@NathanHazout
Copy link

When calling await client.close();, the process still hangs.

When using a real mongo connection, the process is destroyed.

I can see this by running mocha tests that do not terminate when using the mock.

@shaunburdick
Copy link
Collaborator

What does your setup and teardown look like?
Could you post an example of a test not terminating?

@NathanHazout
Copy link
Author

I ended up using mongodb-memory-server, so it will be harder for me to debug this now.

I was doing

const client = await MongoClient.connect(
        "mongodb://localhost:27017/myproject",
        {
          useNewUrlParser: true,
          useUnifiedTopology: true,
        }
      )

At the start, then calling await client.close() at the end of each transaction.

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

No branches or pull requests

2 participants