old_contents: import threading
  import time
  
  import requests
  
  from uvicorn.config import Config
  from uvicorn.main import Server
  
  
  def test_run():
      class App:
          def __init__(self, scope):
              if scope["type"] != "http":
                  raise Exception()
  
          async def __call__(self, receive, send):
              await send({"type": "http.response.start", "status": 204, "headers": []})
              await send({"type": "http.response.body", "body": b"", "more_body": False})
  
      class CustomServer(Server):
          def install_signal_handlers(self):
              pass
  
      config = Config(app=App, loop="asyncio", limit_max_requests=1)
      server = CustomServer(config=config)
      thread = threading.Thread(target=server.run)
      thread.start()
      while not server.started:
          time.sleep(0.01)
      response = requests.get("http://127.0.0.1:8000")
      assert response.status_code == 204
      thread.join()
  
new_contents: import threading
  import time
  
  import requests
  
  from uvicorn.config import Config
  from uvicorn.main import Server
  
  
  def test_run():
      class App:
          def __init__(self, scope):
              if scope["type"] != "http":
                  raise Exception()
  
          async def __call__(self, receive, send):
              await send({"type": "http.response.start", "status": 204, "headers": []})
              await send({"type": "http.response.body", "body": b"", "more_body": False})
  
      class CustomServer(Server):
          def install_signal_handlers(self):
              pass
  
      config = Config(app=App, loop="asyncio", limit_max_requests=1)
      server = CustomServer(config=config)
      thread = threading.Thread(target=server.run)
      thread.start()
      while not server.started:
          time.sleep(0.01)
      response = requests.get("http://127.0.0.1:8000")
      assert response.status_code == 204
      thread.join()
  
  
  def test_run_multiprocess():
      class App:
          def __init__(self, scope):
              if scope["type"] != "http":
                  raise Exception()
  
          async def __call__(self, receive, send):
              await send({"type": "http.response.start", "status": 204, "headers": []})
              await send({"type": "http.response.body", "body": b"", "more_body": False})
  
      class CustomServer(Server):
          def install_signal_handlers(self):
              pass
  
      config = Config(app=App, loop="asyncio", workers=2, limit_max_requests=1)
      server = CustomServer(config=config)
      thread = threading.Thread(target=server.run)
      thread.start()
      while not server.started:
          time.sleep(0.01)
      response = requests.get("http://127.0.0.1:8000")
      assert response.status_code == 204
      thread.join()
  
subject: Add simple multiprocessing test