Skip to content

Commit

Permalink
Merge pull request #827 from jacksontj/TS-4693
Browse files Browse the repository at this point in the history
Ts 4693
  • Loading branch information
jacksontj committed Jul 27, 2016
2 parents 19548db + e302283 commit 346af51
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
25 changes: 20 additions & 5 deletions ci/tsqa/tests/test_hostdb.py
Expand Up @@ -423,6 +423,25 @@ class TestHostDBSRV(helpers.EnvironmentCase):
),
}

# TODO: clean up and push into trafficserver-qa
@property
def proxies(self):
'''
Return a dict of schema -> proxy. This is primarily used for requests
'''
ret = {}
for item in self.configs['records.config']['CONFIG']['proxy.config.http.server_ports'].split():
# TODO: better parsing? For now assume first is port
parts = item.split(':')
dst = 'http://127.0.0.1:{0}'.format(parts[0])
if len(parts) > 1:
if parts[1] not in ret:
ret[parts[1]] = dst
elif 'http' not in ret:
ret['http'] = dst
return ret


@classmethod
def setUpEnv(cls, env):
cls.dns_sock = socket.socket (socket.AF_INET, socket.SOCK_DGRAM)
Expand Down Expand Up @@ -544,8 +563,6 @@ def test_ports(self):

self.assertEqual(expected_set, actual_set)

# TODO: fix, seems broken...
@helpers.unittest.expectedFailure
def test_priority(self):
'''Test port functionality of SRV responses
Expand All @@ -572,7 +589,7 @@ def test_priority(self):
request_distribution[port] = 0
request_distribution[port] += 1

# since one has higher priority, we want to ensure that it got all requests
# since one has a lower priority, we want to ensure that it got all requests
self.assertEqual(
request_distribution[self.responses['_http._tcp.www.foo.com.'][0].rdata.port],
NUM_REQUESTS,
Expand All @@ -581,8 +598,6 @@ def test_priority(self):
finally:
self.responses['_http._tcp.www.foo.com.'] = orig_responses

# TODO: fix, seems broken...
@helpers.unittest.expectedFailure
def test_weight(self):
'''Test port functionality of SRV responses
Expand Down
2 changes: 1 addition & 1 deletion iocore/hostdb/P_HostDBProcessor.h
Expand Up @@ -356,7 +356,7 @@ HostDBRoundRobin::select_best_srv(char *target, InkRand *rand, ink_time_t now, i

do {
// if the real isn't alive-- exclude it from selection
if (info(i).is_alive(now, fail_window)) {
if (!info(i).is_alive(now, fail_window)) {
continue;
}

Expand Down

0 comments on commit 346af51

Please sign in to comment.