code: def test_generator_method_no_retry_without_retry_exceptions(
      shutdown_only,
  ):
      counter = Counter.remote()
      trouble_maker = AsyncTroubleMaker.remote()
  
      gen = trouble_maker.yield_or_raise.remote(
          counter,
          [
              # First round: 1 then raise
              1,
              MyError(),
              # No retry, no second round
              1,
              2,
          ],
      )
      assert ray.get(next(gen)) == 1
      with pytest.raises(MyError):
          ray.get(next(gen))
      with pytest.raises(StopIteration):
          ray.get(next(gen))
      assert ray.get(counter.get_count.remote()) == 2
  
imports: import os
  import sys
  import pytest
  import ray
label_desc: Use image node_id 4 for calling a global function with example usage: test_generator_method_no_retry_without_retry_exceptions(shutdown_only) without return types