code: def test_serve_from_svc():
      from service import svc
  
      server = bentoml.HTTPServer(svc, port=12348)
      server.start()
      client = server.get_client()
      resp = client.health()
      assert resp.status_code == 200
      server.stop()
  
      assert server.process is not None  # process should not be removed
  
      timeout = 10
      start_time = time.time()
      while time.time() - start_time < timeout:
          retcode = server.process.poll()
          if retcode is not None and retcode <= 0:
              break
  
      retcode = server.process.poll()
      assert retcode is not None
  
      if sys.platform == "win32":
          # on Windows, because of the way that terminate is run, it seems the exit code is set.
          pass
      else:
          # negative return codes mean the process was terminated; since we will be terminating
          # the process, it should be negative.
          assert retcode <= 0
  
file_path: BentoML/tests/e2e/bento_server_http/tests/test_serve.py
imports: import asyncio
  import os
  import sys
  import time
  from pathlib import Path
  import pytest
  import bentoml
  from bentoml.exceptions import BentoMLException
  from bentoml.testing.utils import async_request
label_desc: Use image node_id 3 for calling a global function with example usage: test_serve_from_svc() without return types