code: def test_db_multi_client_cleanup():
      with cleanup_subprocesses(strict=True):
          ip1 = InteractiveSubprocess(autostart=True)
          ip2 = InteractiveSubprocess(autostart=True)
          try:
              ip1.run_code(_start_db_snippet)
              ip2.run_code(_start_db_snippet)
              # save a reference to the mongo process before killing ip1
              mongo_process = wait_for_subprocess_by_name(
                  MONGOD_EXE_NAME, process=ip1.process
              )
              ip1.stop()
              # make sure mongo is still reachable
              assert mongo_process.is_running()
              assert MONGOD_EXE_NAME not in get_child_process_names(
                  process=ip2.process
              )
              _check_db_connectivity(ip2)
  
              # make sure a new process can reach mongo
              ip1.start()
              ip1.run_code(_start_db_snippet)
              assert MONGOD_EXE_NAME not in get_child_process_names(
                  process=ip1.process
              )
              _check_db_connectivity(ip1)
              assert ip1.run_code("db.port") == ip2.run_code("db.port")
              assert ip1.run_code(
                  "db.port"
              ) in fosu.get_listening_tcp_ports(mongo_process)
  
              # make sure mongodb exits only after both python processes exit
              ip2.stop()
              assert mongo_process.is_running()
              _check_db_connectivity(ip1)
              ip1.stop()
              # give it a small grace period to exit
              mongo_process.wait(timeout=1)
              assert not mongo_process.is_running()
          finally:
              ip1.stop()
              ip2.stop()
  
imports: from contextlib import contextmanager
  import os
  import sys
  import time
  import unittest
  import psutil
  import requests
  import retrying
  import fiftyone
  import fiftyone.constants
  import fiftyone.core.service
  import fiftyone.service.util
label_desc: Use image node_id 13 for calling a global function with example usage: test_db_multi_client_cleanup() without return types