From fd25366d35e8de36f395e5e49233944a6965d73b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Dulko?= Date: Wed, 4 Nov 2020 15:24:28 +0100 Subject: [PATCH] Increase timeout to read pod commands results exec_command_in_pod was hanging from time to time and we've set a 10 seconds timeout waiting for a response from it. This might be too little as we very often see empty responses being returned. This commit attempts to solve the issue by setting default timeout to 60 seconds. Also the method used is changed from connect_get_namespaced_pod_exec to connect_post_namespaced_pod_exec. This is what `kubectl` uses to perform `exec`, so hopefully it'll be more reliable. Depends-On: I3bbac8e90553be9424fa0ecdb4c05e096da8f2d7 Change-Id: I49ac4d066a0bd0da3833dcbf41655f7c9e374fd9 --- kuryr_tempest_plugin/tests/scenario/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kuryr_tempest_plugin/tests/scenario/base.py b/kuryr_tempest_plugin/tests/scenario/base.py index cba8e1ad..258a3967 100644 --- a/kuryr_tempest_plugin/tests/scenario/base.py +++ b/kuryr_tempest_plugin/tests/scenario/base.py @@ -333,7 +333,7 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): def exec_command_in_pod(self, pod_name, command, namespace="default", stderr=False, container=None, - req_timeout=10, f_timeout=2): + req_timeout=60, f_timeout=2): api = self.k8s_client.CoreV1Api() kwargs = dict(command=command, stdin=False, stdout=True, tty=False, stderr=stderr) @@ -355,7 +355,7 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): kwargs['_request_timeout'] = req_timeout if stderr: kwargs['_preload_content'] = False - resp = stream(api.connect_get_namespaced_pod_exec, + resp = stream(api.connect_post_namespaced_pod_exec, pod_name, namespace, **kwargs) # Run until completion resp.run_forever(timeout=f_timeout)