move health check to just before running test cases

pull/10165/head^2
Eric Gribkoff 8 years ago
parent 246c0eee33
commit 2f59cf2dc3
  1. 2
      tools/jenkins/run_interop.sh
  2. 6
      tools/run_tests/python_utils/dockerjob.py
  3. 23
      tools/run_tests/run_interop_tests.py

@ -36,4 +36,4 @@ export LANG=en_US.UTF-8
# Enter the gRPC repo root
cd $(dirname $0)/../..
tools/run_tests/run_interop_tests.py -l c++ --use_docker --http2_badserver_interop -t -j 12 $@ || true
tools/run_tests/run_interop_tests.py -l all -s all --cloud_to_prod --cloud_to_prod_auth --use_docker --http2_interop --http2_badserver_interop -t -j 12 $@ || true

@ -76,15 +76,13 @@ def wait_for_healthy(cid, shortname, timeout_seconds):
while time.time() - started < timeout_seconds:
try:
output = subprocess.check_output(
['docker', 'inspect', '--format="{{.State.Health.Status}}"', cid])
#stderr=_DEVNULL)
print(output)
['docker', 'inspect', '--format="{{.State.Health.Status}}"', cid],
stderr=_DEVNULL)
if output.strip('\n') == 'healthy':
return
except subprocess.CalledProcessError as e:
pass
time.sleep(1)
print(subprocess.check_output(['docker', 'ps']))
raise Exception('Timed out waiting for %s (%s) to pass health check' %
(shortname, cid))

@ -701,7 +701,7 @@ def server_jobspec(language, docker_image, insecure=False, manual_cmd_log=None):
% ('localhost', _DEFAULT_SERVER_PORT),
'--health-interval=1s',
'--health-retries=5',
'--health-timeout=1s',
'--health-timeout=10s',
]
else:
@ -957,21 +957,15 @@ try:
# don't run the server, set server port to a placeholder value
server_addresses[lang] = ('localhost', '${SERVER_PORT}')
http2_server_job = None
http2_badserver_job = None
if args.http2_badserver_interop:
# launch a HTTP2 server emulator that creates edge cases
lang = str(http2InteropServer)
spec = server_jobspec(http2InteropServer, docker_images.get(lang),
manual_cmd_log=server_manual_cmd_log)
if not args.manual_run:
job = dockerjob.DockerJob(spec)
#job.wait_for_healthy(timeout_seconds=240)
http2_server_job = job
server_jobs[lang] = job
http2_badserver_ports = tuple([
job.mapped_port(_DEFAULT_SERVER_PORT + i)
for i in range(len(_HTTP2_BADSERVER_TEST_CASES))
])
http2_badserver_job = dockerjob.DockerJob(spec)
server_jobs[lang] = http2_badserver_job
else:
# don't run the server, set server port to a placeholder value
server_addresses[lang] = ('localhost', '${SERVER_PORT}')
@ -1056,15 +1050,14 @@ try:
jobs.append(test_job)
if args.http2_badserver_interop:
print(subprocess.check_output(['docker', 'ps']))
http2_server_job.wait_for_healthy(timeout_seconds=600)
if not args.manual_run:
http2_badserver_job.wait_for_healthy(timeout_seconds=600)
for language in languages_http2_badserver_interop:
for test_case in _HTTP2_BADSERVER_TEST_CASES:
offset = sorted(_HTTP2_BADSERVER_TEST_CASES).index(test_case)
server_port = _DEFAULT_SERVER_PORT+offset
if not args.manual_run:
server_port = http2_badserver_ports[offset]
else:
server_port = _DEFAULT_SERVER_PORT+offset
server_port = http2_badserver_job.mapped_port(server_port)
test_job = cloud_to_cloud_jobspec(language,
test_case,
str(http2InteropServer),

Loading…
Cancel
Save