code: def test_add_actor(self):
      self.add_master()
      self.add_worker(n_cpu=1)
      cluster_monitor = ClusterMonitor("localhost:{}".format(self.port))
      time.sleep(1)
      self.assertEqual(0, len(cluster_monitor.data["clients"]))
      parl.connect("localhost:{}".format(self.port))
      time.sleep(20)
      self.assertEqual(1, len(cluster_monitor.data["clients"]))
      self.assertEqual(
          1, cluster_monitor.data["workers"][0]["vacant_cpus"]
      )
      actor = Actor()
      time.sleep(40)
      self.assertEqual(
          0, cluster_monitor.data["workers"][0]["vacant_cpus"]
      )
      self.assertEqual(
          1, cluster_monitor.data["workers"][0]["used_cpus"]
      )
      self.assertEqual(
          1, cluster_monitor.data["clients"][0]["actor_num"]
      )
      del actor
      time.sleep(60)
      self.assertEqual(
          0, cluster_monitor.data["clients"][0]["actor_num"]
      )
      self.assertEqual(
          1, cluster_monitor.data["workers"][0]["vacant_cpus"]
      )
  
file_path: PARL/parl/remote/tests/cluster_monitor_2_test.py
imports: import unittest
  import parl
  from parl.remote.monitor import ClusterMonitor
  import time
  import threading
  from parl.remote import exceptions
  from parl.utils.test_utils import XparlTestCase
label_desc: Use image node_id 1 for calling the TestClusterMonitor obj's underlying member method code with example usage: obj.test_add_actor() without return types