code: def test_compute_worker_run_info_generator(mocker) -> None:
      states = [f"state_{i}" for i in range(7)]
      states[-1] = DockerRunState.COMPLETED
  
      class MockedApiWorkflowClient:
          def __init__(self, states: List[str]):
              self.states = states
              self.current_state_index = 0
              random.seed(42)
  
          def get_compute_worker_run_info(self, scheduled_run_id: str):
              state = self.states[self.current_state_index]
              if random.random() > 0.9:
                  self.current_state_index += 1
              return ComputeWorkerRunInfo(state=state, message=state)
  
      mocker.patch("time.sleep", lambda _: None)
  
      mocked_client = MockedApiWorkflowClient(states)
      run_infos = list(
          ApiWorkflowClient.compute_worker_run_info_generator(
              mocked_client, scheduled_run_id=""
          )
      )
  
      expected_run_infos = [
          ComputeWorkerRunInfo(state=state, message=state)
          for state in states
      ]
  
      assert run_infos == expected_run_infos
  
imports: import json
  import random
  from typing import Any, List
  from unittest import mock
  from unittest.mock import MagicMock
  import pytest
  from pydantic import ValidationError
  from pytest_mock import MockerFixture
  from lightly.api import ApiWorkflowClient, api_workflow_compute_worker
  from lightly.api.api_workflow_compute_worker import STATE_SCHEDULED_ID_NOT_FOUND, ComputeWorkerRunInfo, InvalidConfigurationError, _config_to_camel_case, _snake_to_camel_case, _validate_config
  from lightly.openapi_generated.swagger_client.api import DockerApi
  from lightly.openapi_generated.swagger_client.api_client import ApiClient
  from lightly.openapi_generated.swagger_client.models import DockerRunData, DockerRunScheduledData, DockerRunScheduledPriority, DockerRunScheduledState, DockerRunState, DockerWorkerConfigV3, DockerWorkerConfigV3Docker, DockerWorkerConfigV3DockerCorruptnessCheck, DockerWorkerConfigV3Lightly, DockerWorkerConfigV3LightlyCollate, DockerWorkerConfigV3LightlyLoader, DockerWorkerState, DockerWorkerType, SelectionConfigV3, SelectionConfigV3Entry, SelectionConfigV3EntryInput, SelectionConfigV3EntryStrategy, SelectionInputPredictionsName, SelectionInputType, SelectionStrategyThresholdOperation, SelectionStrategyTypeV3, TagData
  from lightly.openapi_generated.swagger_client.rest import ApiException
  from tests.api_workflow import utils
  from tests.api_workflow.mocked_api_workflow_client import MockedApiWorkflowSetup
label_desc: Use image node_id 15 for calling a global function with example usage: test_compute_worker_run_info_generator(mocker) and returns: ComputeWorkerRunInfo