code: def test_retry0_raises_immediately(cleanup):
      # test that using max_reties=0 raises after 1 call
  
      n_calls = 0
  
      async def coro():
          nonlocal n_calls
          n_calls += 1
          raise RuntimeError(f"RT_ERROR {n_calls}")
  
      async def f():
          return await retry(coro, count=0, delay_min=-1, delay_max=-1)
  
      with pytest.raises(RuntimeError, match="RT_ERROR 1"):
          asyncio_run(f(), loop_factory=get_loop_factory())
  
      assert n_calls == 1
  
imports: from __future__ import annotations
  import asyncio
  import random
  from unittest import mock
  import pytest
  from dask.optimization import SubgraphCallable
  from distributed import wait
  from distributed.compatibility import asyncio_run
  from distributed.config import get_loop_factory
  from distributed.core import ConnectionPool, Status
  from distributed.utils_comm import WrappedKey, gather_from_workers, pack_data, retry, subs_multiple, unpack_remotedata
  from distributed.utils_test import BarrierGetData, BrokenComm, gen_cluster, inc
label_desc: Use image node_id 4 for calling a global function with example usage: test_retry0_raises_immediately(cleanup) and returns: unknown