class_docstr: Tests for async processing logic in horovod.elastic.
class_docstr_tok: ["Tests","for","async","processing","logic","in","horovod.elastic","."]
docstr: Tests that notifications are still sent correctly even if host assignments cannot be generated.
docstr_tok: ["Tests","that","notifications","are","still","sent","correctly","even","if","host","assignments","can","not","be","generated","."]
code: def test_send_notifications_without_assignments(
      self,
      mock_get_worker_client,
      mock_get_coordinator_info,
      mock_host_assignments,
  ):
      """Tests that notifications are still sent correctly even if host assignments cannot be generated."""
      slots = [
          {"host-1": 8, "host-2": 4},
          {"host-1": 8, "host-2": 4},
          {"host-2": 4},
          {"host-2": 4},
          {"host-2": 4, "host-3": 12},
      ]
      discovery = mock.Mock()
      discovery.find_available_hosts_and_slots.side_effect = sequence(
          slots
      )
  
      driver = ElasticDriver(
          mock.Mock(), discovery, min_num_proc=8, max_num_proc=12
      )
      driver.wait_for_available_slots(min_num_proc=16)
      driver.stop()
  
      # On the second call, we should see the number of slots dip below the minimum, but we still want to ensure
      # we notify workers every time there is a change, so in total we should observe 3 calls.
      assert mock_get_worker_client.call_count == 3
      assert mock_get_coordinator_info.call_count == 3
  
imports: import time
  import unittest
  import warnings
  import mock
  import pytest
  from horovod.runner.util import network
  from horovod.runner.elastic.discovery import FixedHosts, HostManager
  from horovod.runner.elastic.driver import ElasticDriver
  from horovod.runner.elastic.rendezvous import create_rendezvous_handler
  from horovod.runner.elastic.worker import HostUpdateResult, WorkerNotificationManager
  from horovod.runner.http.http_server import RendezvousServer
label_desc: Use image node_id 11 for calling the ElasticDriverTests obj's underlying member method code with example usage: obj.test_send_notifications_without_assignments(mock_get_worker_client, mock_get_coordinator_info, mock_host_assignments) without return types