docstr: Tests whether eval workers warn appropriately after some episode timeout.
docstr_tok: ["Tests","whether","eval","workers","warn","appropriately","after","some","episode","timeout","."]
code: def test_eval_workers_on_infinite_episodes(self):
      """Tests whether eval workers warn appropriately after some episode timeout."""
      # Create infinitely running episodes, but with horizon setting (RLlib will
      # auto-terminate the episode). However, in the eval workers, don't set a
      # horizon -> Expect warning and no proper evaluation results.
      config = (
          PPOConfig()
          .environment(env=RandomEnv, env_config={"p_terminated": 0.0})
          .reporting(metrics_episode_collection_timeout_s=5.0)
          .evaluation(
              evaluation_num_workers=2,
              evaluation_interval=1,
              evaluation_sample_timeout_s=5.0,
          )
      )
      algo = config.build()
      results = algo.train()
      self.assertTrue(
          np.isnan(results["evaluation"]["episode_reward_mean"])
      )
  
imports: from collections import defaultdict
  import gymnasium
  import numpy
  import time
  import unittest
  import ray
  from ray.util.state import list_actors
  from ray.rllib.algorithms.algorithm_config import AlgorithmConfig
  from ray.rllib.algorithms.callbacks import DefaultCallbacks
  from ray.rllib.algorithms.dqn.dqn import DQNConfig
  from ray.rllib.algorithms.impala import ImpalaConfig
  from ray.rllib.algorithms.pg import PGConfig
  from ray.rllib.algorithms.pg.pg_tf_policy import PGTF2Policy
  from ray.rllib.algorithms.pg.pg_torch_policy import PGTorchPolicy
  from ray.rllib.algorithms.ppo import PPOConfig
  from ray.rllib.env.multi_agent_env import make_multi_agent
  from ray.rllib.evaluation.rollout_worker import RolloutWorker
  from ray.rllib.examples.env.random_env import RandomEnv
  from ray.rllib.utils.test_utils import framework_iterator
  from ray.tune.registry import register_env
label_desc: Use image node_id 19 for calling the TestWorkerFailures obj's underlying member method code with example usage: obj.test_eval_workers_on_infinite_episodes() without return types