code: def test_ssh_manager_close_no_throw(bogus_socket=None):
      manager = MultiplexSSHManager()
  
      class bogus:
          def close(self):
              raise Exception("oh I am so bad")
  
          @property
          def ctrl_path(self):
              with open(bogus_socket, "w") as f:
                  f.write("whatever")
              return Path(bogus_socket)
  
      # since we are digging into protected area - should also set _prev_connections
      manager._prev_connections = {}
      manager._connections["bogus"] = bogus()
      assert_raises(Exception, manager.close)
      assert_raises(Exception, manager.close)
  
      # but should proceed just fine if allow_fail=False
      with swallow_logs(new_level=logging.DEBUG) as cml:
          manager.close(allow_fail=False)
          assert_in(
              "Failed to close a connection: oh I am so bad", cml.out
          )
  
file_path: datalad/datalad/support/tests/test_sshconnector.py
imports: import logging
  import os.path
  from os.path import exists, getmtime, isdir
  from os.path import join
  from datalad.tests.utils_pytest import SkipTest, assert_false, assert_in, assert_is_instance, assert_raises, eq_, get_most_obscure_supported_name, get_ssh_port, ok_, patch_config, skip_if_on_windows, skip_nomultiplex_ssh, skip_ssh, swallow_logs, with_tempfile, with_tree
  from datalad.utils import Path
  from ..sshconnector import MultiplexSSHConnection, MultiplexSSHManager, NoMultiplexSSHConnection, SSHConnection, SSHManager, get_connection_hash, sh_quote
label_desc: Use image node_id 4 for calling a global function with example usage: test_ssh_manager_close_no_throw(bogus_socket) and returns: Path