Skip to content
Snippets Groups Projects
Commit 39e3cb3a authored by Jan Tattermusch's avatar Jan Tattermusch
Browse files

prevent container name reuse error for timeout flakes

parent 33d35d5b
No related branches found
No related tags found
No related merge requests found
......@@ -272,6 +272,8 @@ class Job(object):
message('TIMEOUT_FLAKE', self._spec.shortname, stdout, do_newline=True)
self._timeout_retries += 1
self.result.retries = self._timeout_retries + self._retries
if self._spec.kill_handler:
self._spec.kill_handler(self)
self._process.terminate()
self.start()
else:
......
......@@ -344,6 +344,11 @@ def add_auth_options(language, test_case, cmdline, env):
def _job_kill_handler(job):
if job._spec.container_name:
dockerjob.docker_kill(job._spec.container_name)
# When the job times out and we decide to kill it,
# we need to wait a before restarting the job
# to prevent "container name already in use" error.
# TODO(jtattermusch): figure out a cleaner way to to this.
time.sleep(2)
def cloud_to_prod_jobspec(language, test_case, docker_image=None, auth=False):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment