class_docstr: Tests for async processing logic in horovod.elastic.
class_docstr_tok: ["Tests","for","async","processing","logic","in","horovod.elastic","."]
docstr: Tests the order is preserved for host assignment as available hosts are updated.
docstr_tok: ["Tests","the","order","is","preserved","for","host","assignment","as","available","hosts","are","updated","."]
code: def test_order_available_hosts(self):
      """Tests the order is preserved for host assignment as available hosts are updated."""
      # This will be a set in practice, but use a list here to guarantee order.
      available_hosts = ["a", "b", "c"]
      ordered_hosts = []
      ordered_hosts = HostManager.order_available_hosts(
          available_hosts, ordered_hosts
      )
      assert ordered_hosts == available_hosts
  
      # We remove a host, add a host, and chance the order, but relative order should be preserved
      available_hosts = ["d", "c", "b"]
      ordered_hosts = HostManager.order_available_hosts(
          available_hosts, ordered_hosts
      )
      assert ordered_hosts == ["b", "c", "d"]
  
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 12 for calling the ElasticDriverTests obj's underlying member method code with example usage: obj.test_order_available_hosts() without return types