code: def test_timer_zero_duration_stop(tmpdir, interval):
      """Test that the timer stops training immediately after the first check occurs."""
      model = BoringModel()
      duration = timedelta(0)
      timer = Timer(duration=duration, interval=interval)
      trainer = Trainer(default_root_dir=tmpdir, callbacks=[timer])
      trainer.fit(model)
      assert trainer.global_step == 0
      assert trainer.current_epoch == 0
  
imports: import logging
  import time
  from datetime import timedelta
  from unittest.mock import Mock, patch
  import pytest
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks import ModelCheckpoint
  from lightning.pytorch.callbacks.timer import Timer
  from lightning.pytorch.demos.boring_classes import BoringModel
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 6 for calling a global function with example usage: test_timer_zero_duration_stop(tmpdir, interval) without return types