micro-analytics / micro-analytics/micro-analytics-cli

Connection leaks in adapter tests

Open
#75 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

adapter-tests help wanted
Dominant language
JavaScript
Stars
732
Forks
39
PR merge metrics
No merged PRs in 30d

Description

The adapter tests does not close connection correctly resulting in tests for the redis adapter never quitting.

The problem is the at the moment is call init should not throw. Overwrites the connections with new one and then when the tests closes connection in afterEach the connection created in beforeEach is not closed.

I think it would be a good thing to require adapter.close() and handle the closing of database connections in the adapter utils.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the adapter tests around call init should not throw, then inspect the adapter utils and the beforeEach/afterEach connection lifecycle. Reproduce the Redis adapter tests and trace which connection is replaced; done means every connection created by the tests is closed and the Redis tests quit cleanly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, redis
Domain
backend, databases, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.