code: def test_update_within_interval(client_mock, monotonic_mock):
      cloud_backend = CloudBackend("", status_update_interval=2)
      cloud_backend._last_time_updated = 1
      # pretend a lot of time has passed since the last update
      monotonic_mock.return_value = 8
  
      stopped_mock1 = Mock()
      stopped_mock1.has_started = False
      stopped_mock1.name = "root.mock1"
      stopped_mock2 = Mock()
      stopped_mock2.has_started = False
      stopped_mock2.name = "root.mock2"
  
      spec1 = Mock()
      spec1.name = "root.mock1"
      spec2 = Mock()
      spec2.name = "root.mock2"
  
      # not all works have started
      works = [stopped_mock1, stopped_mock2]
  
      cloud_backend.update_work_statuses(works=works)
      client_mock().lightningwork_service_list_lightningwork.assert_called_with(
          project_id="project_id", app_id="app_id"
      )
  
imports: import json
  import os
  from copy import copy
  from datetime import datetime
  from unittest import mock
  from unittest.mock import ANY, MagicMock, Mock
  import pytest
  from lightning.app import BuildConfig, CloudCompute, LightningWork
  from lightning.app.launcher.lightning_backend import CloudBackend
  from lightning.app.storage import Drive, Mount
  from lightning.app.testing.helpers import EmptyWork
  from lightning.app.utilities.enum import WorkFailureReasons, WorkStageStatus
  from lightning.app.utilities.exceptions import LightningPlatformException
  from lightning_cloud.openapi import Body5, V1DriveType, V1LightningworkState, V1SourceType
  from lightning_cloud.openapi.rest import ApiException
label_desc: Use image node_id 4 for calling a global function with example usage: test_update_within_interval(client_mock, monotonic_mock) without return types