code: def test_idle_connection_manager(mocker):
      t = mocker.patch.object(time, "time")
      t.return_value = 0
  
      idle = IdleConnectionManager(100)
      assert idle.next_check_ms() == float("inf")
  
      idle.update("foo")
      assert not idle.is_expired("foo")
      assert idle.poll_expired_connection() is None
      assert idle.next_check_ms() == 100
  
      t.return_value = 90 / 1000
      assert not idle.is_expired("foo")
      assert idle.poll_expired_connection() is None
      assert idle.next_check_ms() == 10
  
      t.return_value = 100 / 1000
      assert idle.is_expired("foo")
      assert idle.next_check_ms() == 0
  
      conn_id, conn_ts = idle.poll_expired_connection()
      assert conn_id == "foo"
      assert conn_ts == 0
  
      idle.remove("foo")
      assert idle.next_check_ms() == float("inf")
  
imports: from __future__ import absolute_import, division
  import socket
  import time
  import pytest
  from kafka.client_async import KafkaClient, IdleConnectionManager
  from kafka.cluster import ClusterMetadata
  from kafka.conn import ConnectionStates
  import kafka.errors
  from kafka.future import Future
  from kafka.protocol.metadata import MetadataRequest
  from kafka.protocol.produce import ProduceRequest
  from kafka.structs import BrokerMetadata
label_desc: Use image node_id 24 for calling a global function with example usage: test_idle_connection_manager(mocker) without return types