code: def test_retry_respects_secondary_timeout(mock_time: MockTime):
      func = mock.Mock()
      func.side_effect = ValueError
  
      t0 = mock_time.now()
  
      def check_retry_timeout(e):
          if isinstance(e, ValueError):
              return datetime.timedelta(minutes=10)
  
      retry_timedelta = datetime.timedelta(hours=7)
      retrier = retry.Retry(
          func,
          retryable_exceptions=(ValueError,),
          check_retry_fn=check_retry_timeout,
          retry_timedelta=retry_timedelta,
          num_retries=10000,
      )
      with pytest.raises(ValueError):
          retrier()
  
      # add some slop for other timeout calls, should be about 10 minutes of retries
      assert 10 <= (mock_time.now() - t0).total_seconds() / 60 < 20
  
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 6 for calling a global function with example usage: test_retry_respects_secondary_timeout(mock_time) and returns: datetime