Merge pull request #17856 from ClickHouse/fix_test_log_s3

Kill network container with retries in integration tests
This commit is contained in:
alesapin 2020-12-07 19:07:02 +03:00 committed by GitHub
commit 5f35279c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,11 +173,16 @@ class _NetworkManager:
def _ensure_container(self): def _ensure_container(self):
if self._container is None or self._container_expire_time <= time.time(): if self._container is None or self._container_expire_time <= time.time():
for i in range(5):
if self._container is not None: if self._container is not None:
try: try:
self._container.remove(force=True) self._container.remove(force=True)
break
except docker.errors.NotFound: except docker.errors.NotFound:
pass break
except Exception as ex:
print("Error removing network blocade container, will try again", str(ex))
time.sleep(i)
image = subprocess.check_output("docker images -q yandex/clickhouse-integration-helper 2>/dev/null", shell=True) image = subprocess.check_output("docker images -q yandex/clickhouse-integration-helper 2>/dev/null", shell=True)
if not image.strip(): if not image.strip():