Add tests for connection close