move health check to just before running test cases
diff --git a/tools/jenkins/run_interop.sh b/tools/jenkins/run_interop.sh
index 18e8b64..2a9fc66 100755
--- a/tools/jenkins/run_interop.sh
+++ b/tools/jenkins/run_interop.sh
@@ -36,4 +36,4 @@
# 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
diff --git a/tools/run_tests/python_utils/dockerjob.py b/tools/run_tests/python_utils/dockerjob.py
index a295554..709fc12 100755
--- a/tools/run_tests/python_utils/dockerjob.py
+++ b/tools/run_tests/python_utils/dockerjob.py
@@ -76,15 +76,13 @@
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))
diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py
index 5791149..ce4dfb8 100755
--- a/tools/run_tests/run_interop_tests.py
+++ b/tools/run_tests/run_interop_tests.py
@@ -701,7 +701,7 @@
% ('localhost', _DEFAULT_SERVER_PORT),
'--health-interval=1s',
'--health-retries=5',
- '--health-timeout=1s',
+ '--health-timeout=10s',
]
else:
@@ -957,21 +957,15 @@
# 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 @@
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),