Skip to content

Commit c1dbc06

Browse files
committed
Handle unclean connection closures in close()
Also fixes the unit tests that uses mock connection
1 parent b62ae1e commit c1dbc06

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

juju/client/connection.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,9 @@ async def close(self, to_reconnect=False):
456456
await jasyncio.gather(*jasyncio.all_tasks())
457457
except jasyncio.CancelledError:
458458
pass
459+
except websockets.exceptions.ConnectionClosed:
460+
pass
461+
459462
self._pinger_task = None
460463
self._receiver_task = None
461464
self._debug_log_task = None

0 commit comments

Comments
 (0)