charmed-kubernetes / pytest-operator

Apache License 2.0
6 stars 13 forks source link

Address destroying all connections to the juju controller. #76

Closed addyess closed 2 years ago

addyess commented 2 years ago

Addressing https://github.com/charmed-kubernetes/pytest-operator/issues/75

Every connection to the juju controller must also be closed, otherwise the event_loop will have connection tasks which aren't cleaned up by the async portions of websocket and python-libjuju libraries.

Whenever a new model is added, a new connection is opened Whenever a Controller.connect() method is called, a new connection is opened.

the _add_model(...) method was opening a connection to a controller which wasn't cleaned up during the _setup_model(...) method.