code: def test_multiprocess_starts_frontend_servers(
      mock_find_free_network_port,
      monkeypatch,
      cloudspace_host,
      port,
      expected_host,
      expected_target,
  ):
      """Test that the MultiProcessRuntime starts the servers for the frontends in each LightningFlow."""
  
      monkeypatch.setattr(
          constants, "LIGHTNING_CLOUDSPACE_HOST", cloudspace_host
      )
      mock_find_free_network_port.return_value = port
  
      root = StartFrontendServersTestFlow()
      app = LightningApp(root)
      MultiProcessRuntime(app).dispatch()
  
      app.frontends[root.flow0.name].start_server.assert_called_once()
      assert (
          app.frontends[root.flow0.name].start_server.call_args.kwargs[
              "host"
          ]
          == expected_host
      )
  
      app.frontends[root.flow1.name].start_server.assert_called_once()
      assert (
          app.frontends[root.flow1.name].start_server.call_args.kwargs[
              "host"
          ]
          == expected_host
      )
  
      assert (
          app.frontends[root.flow0.name].flow._layout["target"]
          == f"{expected_target}/{root.flow0.name}"
      )
      assert (
          app.frontends[root.flow1.name].flow._layout["target"]
          == f"{expected_target}/{root.flow1.name}"
      )
  
      app.frontends[root.flow0.name].stop_server.assert_called_once()
      app.frontends[root.flow1.name].stop_server.assert_called_once()
  
imports: import os
  import sys
  from unittest import mock
  from unittest.mock import Mock
  import pytest
  from lightning.app import LightningApp, LightningFlow, LightningWork
  from lightning.app.core import constants
  from lightning.app.frontend import StaticWebFrontend, StreamlitFrontend
  from lightning.app.runners import MultiProcessRuntime
  from lightning.app.utilities.component import _get_context
  from lightning.app.utilities.imports import _IS_WINDOWS
label_desc: Use image node_id 2 for calling a global function with example usage: test_multiprocess_starts_frontend_servers(mock_find_free_network_port, monkeypatch, cloudspace_host, port, expected_host, expected_target) without return types