code: def test_log_server(self):
      master_port = self.port
      # start the master
      master = Master(port=master_port)
      th = threading.Thread(target=master.run)
      th.start()
      time.sleep(10)
  
      self.add_worker(n_cpu=4)
  
      cluster_addr = "localhost:{}".format(self.port)
      outputs = self._connect_and_create_actor(cluster_addr)
  
      # Get status
      status = master._get_status()
      client_jobs = pickle.loads(status).get("client_jobs")
      self.assertIsNotNone(client_jobs)
  
      # Get job id
      client = get_global_client()
      jobs = client_jobs.get(client.client_id)
      self.assertIsNotNone(jobs)
  
      for job_id, log_server_addr in jobs.items():
          log_url = "http://{}/get-log".format(log_server_addr)
          # Test response without job_id
          r = requests.get(log_url)
          self.assertEqual(r.status_code, 400)
          # Test normal response
          r = requests.get(log_url, params={"job_id": job_id})
          self.assertEqual(r.status_code, 200)
          log_content = json.loads(r.text).get("log")
          self.assertIsNotNone(log_content)
          log_content = log_content.replace("\r\n", "\n")
          self.assertIn(log_content, outputs)
  
          # Test download
          download_url = "http://{}/download-log".format(
              log_server_addr
          )
          r = requests.get(download_url, params={"job_id": job_id})
          self.assertEqual(r.status_code, 200)
          log_content = r.text.replace("\r\n", "\n")
          self.assertIn(log_content, outputs)
      master.exit()
  
imports: import json
  import multiprocessing
  import os
  import pickle
  import subprocess
  import sys
  import tempfile
  import threading
  import time
  import unittest
  import requests
  import parl
  from parl.remote.client import disconnect, get_global_client
  from parl.utils import _IS_WINDOWS
  from parl.utils.test_utils import XparlTestCase
  from parl.utils import get_free_tcp_port
  from parl.remote.master import Master
label_desc: Use image node_id 2 for calling the TestLogServer obj's underlying member method code with example usage: obj.test_log_server() without return types