Fixed test filtering for Integration tests, removed redundant server starting up.

This commit is contained in:
Timofey 2015-11-16 14:26:28 +03:00
parent 5146fc3c6e
commit 24f1e9f8d9
2 changed files with 6 additions and 8 deletions

View file

@ -141,7 +141,7 @@ class SiblingKiller:
def wait_for_server(self):
for i in range(0, 2):
if self.ping(): # unsuccessful ping takes 5 seconds (look at PING_TIMEOUT)
if self.ping(): # unsuccessful ping takes 5 seconds (look at PING_TIMEOUT) iff there is a dead server occupying the port
return True
return False
@ -162,7 +162,7 @@ class SiblingKiller:
def serving_process_id(self):
resp = str()
try:
response = urllib2.urlopen('http://localhost:{port}/id'.format(port=PORT), timeout=self.ping_timeout);
response = urllib2.urlopen('http://localhost:{port}/id'.format(port=self.port), timeout=self.ping_timeout);
resp = response.read()
id = int(resp)
return id

View file

@ -116,11 +116,9 @@ class TestRunner:
not_found = filter(not_on_disk, self.runlist)
# now let's move the tests that need a server either to the beginning or the end of the tests_to_run list
tests_with_server = TESTS_REQUIRING_SERVER
for test in tests_with_server:
tests_with_server = list(TESTS_REQUIRING_SERVER)
for test in TESTS_REQUIRING_SERVER:
if test in tests_to_run:
tests_to_run.remove(test)
else:
@ -204,10 +202,10 @@ class TestRunner:
results = dict()
for key in to_run_and_with_server_keys:
if key == WITH_SERVER:
if key == WITH_SERVER and categorized_tests[WITH_SERVER]:
self.start_server()
results = self.merge_dicts_of_lists(results, self.run_tests(categorized_tests[key]))
if key == WITH_SERVER:
if key == WITH_SERVER and categorized_tests[WITH_SERVER]:
self.stop_server()
self.print_pretty("failed", results[FAILED])