Raise tobiko_start_pod_timeout default value

It seems tobiko_start_pod_timeout default value of 100 seconds is
sometimes not enough. This patch raises its value to 300 seconds.

With this patch, it the pod creation fails (due to timeout or something
else), an error message is printed including the pod description.

Change-Id: Id663a09a7a87b23dd9c7aa98698bc1d946053d9b
Signed-off-by: Eduardo Olivares <eolivare@redhat.com>
This commit is contained in:
Eduardo Olivares
2025-07-14 17:47:39 +02:00
parent ddd65c50ee
commit 39c7ef2f2b
2 changed files with 13 additions and 5 deletions

View File

@@ -413,10 +413,18 @@ def _start_pod(cmd, args, pod_name, pod_image):
with tobiko_project_context():
pod_sel = oc.create(pod_def)
with oc.timeout(CONF.tobiko.podified.tobiko_start_pod_timeout):
success, pod_objs, _ = pod_sel.until_all(
success_func=lambda pod:
pod.as_dict()['status']['phase'] == 'Running'
)
try:
success, pod_objs, _ = pod_sel.until_all(
success_func=lambda pod:
pod.as_dict()['status']['phase'] == 'Running'
)
except oc.OpenShiftPythonException:
LOG.error(f'Pod {pod_name} creation failed')
pod_describe = oc.selector(
f'pod/{pod_name}').object().describe()
LOG.error(f'{pod_describe}')
raise
if success:
return pod_objs[0]

View File

@@ -53,7 +53,7 @@ OPTIONS = [
'this version supports "--json-stream" option required '
'by Tobiko.'),
cfg.IntOpt('tobiko_start_pod_timeout',
default=100,
default=300,
help='Defines how long Tobiko will wait until POD with the '
'background command (like tobiko ping) will be `Running`. '
'In most cases, if tobiko image is already in the local '