code: def test_calls_on_exc(self, mock_time: MockTime):
      backoff = mock.Mock(
          spec=retry.Backoff,
          next_sleep_or_reraise=mock.Mock(return_value=1 * SECOND),
      )
  
      excs = [MyError("one"), MyError("two")]
  
      fn_sync = mock.Mock(
          side_effect=[
              *excs,
              lambda: None,
          ],
      )
  
      async def fn():
          return fn_sync()
  
      on_exc = mock.Mock()
      asyncio.run(retry.retry_async(backoff, fn, on_exc=on_exc))
  
      on_exc.assert_has_calls(
          [
              mock.call(excs[0]),
              mock.call(excs[1]),
          ]
      )
  
imports: import asyncio
  import dataclasses
  import datetime
  from typing import Iterator
  from unittest import mock
  import pytest
  from wandb.sdk.lib import retry
label_desc: Use image node_id 2 for calling the TestRetryAsync obj's underlying member method code with example usage: obj.test_calls_on_exc(mock_time) and returns: fn_sync