code: def test_status_time(self, mock_time):
      mock_time.return_value = 1
      instance = InstanceUtil.new_instance("i-123", "type_1", "rq-1")
      # OK
      assert (
          InstanceUtil.get_status_times_ns(instance, Instance.QUEUED)[0]
          == 1
      )
      # No filter.
      assert InstanceUtil.get_status_times_ns(
          instance,
      ) == [1]
  
      # Missing status returns empty list
      assert (
          InstanceUtil.get_status_times_ns(instance, Instance.REQUESTED)
          == []
      )
  
      # Multiple status.
      mock_time.return_value = 2
      InstanceUtil.set_status(instance, Instance.REQUESTED)
      mock_time.return_value = 3
      InstanceUtil.set_status(instance, Instance.ALLOCATION_FAILED)
      mock_time.return_value = 4
      InstanceUtil.set_status(instance, Instance.QUEUED)
      assert InstanceUtil.get_status_times_ns(
          instance, Instance.QUEUED
      ) == [1, 4]
  
file_path: ray/python/ray/autoscaler/v2/tests/test_instance_manager.py
imports: import os
  import sys
  import unittest
  from typing import Dict, Set
  from unittest.mock import patch
  import pytest
  from ray.autoscaler.v2.instance_manager.instance_manager import InstanceUtil
  from ray.autoscaler.v2.schema import InvalidInstanceStatusError
  from ray.core.generated.instance_manager_pb2 import Instance
label_desc: Use image node_id 3 for calling the InstanceUtilTest obj's underlying member method code with example usage: obj.test_status_time(mock_time) without return types