code: def test_method_exit_no_over_retry_max_restarts(shutdown_only):
      """
      Even if we have enough _max_retries, we may still raise due to max_restarts.
      """
      counter = Counter.remote()
      trouble_maker = TroubleMaker.options(max_restarts=1).remote()
      with pytest.raises(ray.exceptions.RayActorError):
          assert ray.get(
              trouble_maker.raise_or_exit.options(
                  _max_retries=4
              ).remote(counter, ["raise", "exit", "exit"])
          )
      # 2 calls: 1 initial + 1 exception-retry + 1 exit-retry (then no more)
      assert ray.get(counter.get_count.remote()) == 3
  
imports: import os
  import sys
  import pytest
  import ray
label_desc: Use image node_id 11 for calling a global function with example usage: test_method_exit_no_over_retry_max_restarts(shutdown_only) without return types