code: def test_validation_check_interval_exceed_data_length_correct(
      tmpdir, use_infinite_dataset, accumulate_grad_batches
  ):
      data_samples_train = 4
      max_epochs = 3
      max_steps = data_samples_train * max_epochs
      max_opt_steps = max_steps // accumulate_grad_batches
  
      class TestModel(BoringModel):
          def __init__(self):
              super().__init__()
              self.validation_called_at_step = set()
  
          def validation_step(self, *args):
              self.validation_called_at_step.add(
                  self.trainer.fit_loop.total_batch_idx + 1
              )
              return super().validation_step(*args)
  
          def train_dataloader(self):
              train_ds = (
                  RandomIterableDataset(32, count=max_steps + 100)
                  if use_infinite_dataset
                  else RandomDataset(32, length=data_samples_train)
              )
              return DataLoader(train_ds)
  
      model = TestModel()
      trainer = Trainer(
          default_root_dir=tmpdir,
          limit_val_batches=1,
          max_steps=max_opt_steps,
          val_check_interval=3,
          check_val_every_n_epoch=None,
          num_sanity_val_steps=0,
          accumulate_grad_batches=accumulate_grad_batches,
      )
  
      trainer.fit(model)
  
      assert (
          trainer.current_epoch == 1
          if use_infinite_dataset
          else max_epochs
      )
      assert trainer.global_step == max_opt_steps
      assert sorted(model.validation_called_at_step) == [3, 6, 9, 12]
  
file_path: pytorch-lightning/tests/tests_pytorch/trainer/flags/test_val_check_interval.py
imports: import logging
  import pytest
  from lightning.pytorch.demos.boring_classes import BoringModel, RandomDataset, RandomIterableDataset
  from lightning.pytorch.trainer.trainer import Trainer
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from torch.utils.data import DataLoader
label_desc: Use image node_id 3 for calling a global function with example usage: test_validation_check_interval_exceed_data_length_correct(tmpdir, use_infinite_dataset, accumulate_grad_batches) and returns: super, DataLoader