Home | History | Annotate | Download | only in scheduler

Lines Matching refs:hosts

37         # Unfortunately the hosts labels are labelnames, not ids.
45 def find_matching_host_for_request(hosts, request):
46 """Find a host from the given list of hosts, matching the request.
48 @param hosts: A list of dictionaries representing host attributes.
53 if not hosts or not request:
55 for host in hosts:
76 hosts = result.get(request)
78 if hosts and len(hosts) == count:
80 # Go through all hosts given to lower priority requests and
98 requests, by re-validating all the hosts assigned to a lower priority
107 # could not have been satisfied by hosts assigned to requests lower
114 for hosts in result.values():
115 for host in hosts:
134 hosts = list(rdb_lib.acquire_hosts(queue_entries))
135 self.assertTrue(len(hosts) == 1 and hosts[0] is None)
139 """Test behaviour when hosts are leased just before acquisition.
141 If a fraction of the hosts somehow get leased between finding and
142 acquisition, the rdb should just return the remaining hosts for the
150 hosts = [self.db_helper.create_host('h1', deps=set(['a'])),
155 """Return a predetermined list of hosts, one of which is leased."""
165 hosts = list(rdb_lib.acquire_hosts(queue_entries))
166 self.assertTrue(len(hosts) == 2 and None in hosts)
167 self.check_hosts(iter(hosts))
234 If multiple hosts satisfied a job's deps, the one with preferred
247 # Hosts lumpy1 and lumpy2 are created as a control group,
273 """Test that we find no hosts when only acls match.
289 """Test that we find no hosts when only deps match.
300 # aclgroups. Though there are several hosts in the Everyone group, the
335 Increases a job's priority and makes several requests for hosts,
396 hosts = list(rdb_lib.acquire_hosts(queue_entries))
397 self.assertTrue(len(hosts) == 2 and None in hosts)
398 returned_host = [host for host in hosts if host].pop()
426 for request, hosts in result.iteritems():
429 if len(hosts) > 1:
430 raise ValueError('Multiple hosts returned against one '
432 yield hosts[0]
440 """Test that older suite jobs acquire hosts first.
442 Make sure older suite jobs get hosts first, but not at the expense of
446 suite_job_2 acquires the last 2 hosts instead of suite_job_1.
447 isolated_important_job doesn't get any hosts.
448 Any job acquires more hosts than necessary.
464 # Create 3 hosts, all with the deps to satisfy the last suite.
494 # first suite got both remaining free hosts.
495 for request, hosts in result.iteritems():
497 if len(hosts) > 1:
498 raise ValueError('First job acquired more hosts than '
502 if len(hosts) < 2:
506 # The second suite job got hosts instead of one of
544 @param num_hosts: Total number of hosts to create.
554 hosts = []
556 hosts.append(self.db_helper.create_host(
564 # Empty list will be used to store acquired hosts.
573 for setting, hosts in suites.itervalues():
574 self.assertEqual(len(hosts),setting['expected_aquired'])