docstr: Test that logging actors are killed if exceeding the upload timeout
  upon experiment completion.
docstr_tok: ["Test","that","logging","actors","are","killed","if","exceeding","the","upload","timeout","upon","experiment","completion","."]
code: def test_wandb_kill_hanging_actor(self, trial):
      """Test that logging actors are killed if exceeding the upload timeout
      upon experiment completion."""
  
      class HangingFinishMockWandbAPI(_MockWandbAPI):
          def finish(self):
              time.sleep(5)
  
      logger = get_mock_wandb_logger(
          mock_api_cls=HangingFinishMockWandbAPI,
          upload_timeout=0.1,
      )
      logger.setup()
      logger.on_trial_start(0, [], trial)
      logger.on_trial_complete(0, [], trial)
      # Signalling stop will not cleanup fully due to the hanging finish
      assert logger._trial_logging_actors
      actor = logger._trial_logging_actors[trial]
      # Experiment end hook should kill actors since upload_timeout < 5
      logger.on_experiment_end(trials=[trial])
      assert not logger._trial_logging_actors
      gc.collect()
      with pytest.raises(RayActorError):
          ray.get(actor.get_state.remote())
  
imports: import gc
  from pathlib import Path
  import numpy
  import os
  import pytest
  import time
  import tempfile
  from unittest.mock import Mock, patch
  import ray
  from ray.exceptions import RayActorError
  from ray.air.integrations.wandb import WandbLoggerCallback, _QueueItem, _WandbLoggingActor
  from ray.air.integrations.wandb import WANDB_ENV_VAR, WANDB_GROUP_ENV_VAR, WANDB_POPULATE_RUN_LOCATION_HOOK, WANDB_PROJECT_ENV_VAR, WANDB_SETUP_API_KEY_HOOK
  from ray.tune.execution.placement_groups import PlacementGroupFactory
  from ray.air.tests.mocked_wandb_integration import _MockWandbAPI, _MockWandbLoggingActor, Trial, WandbTestExperimentLogger, get_mock_wandb_logger
label_desc: Use image node_id 15 for calling the TestWandbLogger obj's underlying member method code with example usage: obj.test_wandb_kill_hanging_actor(trial) without return types