add tests for connection management