kalisio/feathers-distributed

Open connections prevent process to close

claustres opened this issue · 1 comments

Steps to reproduce

Create a distributed application and use it through mocha tests

Expected behavior

The process should close at the end of the tests

Actual behavior

The process does not close due to connections that are still open, ie service publisher/subscriber on the app. This is not really annoying when launching a long-lived server but it is for running tests.

There can also be timeouts running linked to publicationDelay and coteDelay.

It seems that cote components exhibits a close() method that should be called to clean up. We could also keep track of the timeout objects to cancel it. Should we provide a global colseDistribution() at app level or provide individual functions to clear app/service-level timeouts/components ?

System configuration

Tell us about the applicable parts of your setup.

Module versions (especially the part that's not working): 0.7

NodeJS version: 8.16

Operating System: Windows

If we remove the --exit flag in our own mocha tests the problem appears.