diff options
author | 2017-03-16 13:44:09 -0700 | |
---|---|---|
committer | 2017-03-17 00:46:01 -0700 | |
commit | 2f59cf2dc361e274bf97550447d5a72c8f239704 (patch) | |
tree | 0d8d955f0d4a1c0e2cef6b881ac3aa648ea4c2d3 /tools | |
parent | 246c0eee336fd657f82c9f4503295164efbdf9a6 (diff) |
move health check to just before running test cases
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/jenkins/run_interop.sh | 2 | ||||
-rwxr-xr-x | tools/run_tests/python_utils/dockerjob.py | 6 | ||||
-rwxr-xr-x | tools/run_tests/run_interop_tests.py | 23 |
3 files changed, 11 insertions, 20 deletions
diff --git a/tools/jenkins/run_interop.sh b/tools/jenkins/run_interop.sh index 18e8b64438..2a9fc662a9 100755 --- a/tools/jenkins/run_interop.sh +++ b/tools/jenkins/run_interop.sh @@ -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 diff --git a/tools/run_tests/python_utils/dockerjob.py b/tools/run_tests/python_utils/dockerjob.py index a29555428b..709fc121a9 100755 --- a/tools/run_tests/python_utils/dockerjob.py +++ b/tools/run_tests/python_utils/dockerjob.py @@ -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)) diff --git a/tools/run_tests/run_interop_tests.py b/tools/run_tests/run_interop_tests.py index 579114939f..ce4dfb863e 100755 --- a/tools/run_tests/run_interop_tests.py +++ b/tools/run_tests/run_interop_tests.py @@ -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), |