From 562f886e30f511925998fb4c595c2f61addc0a77 Mon Sep 17 00:00:00 2001 From: benbierens Date: Wed, 4 Oct 2023 09:26:11 +0200 Subject: [PATCH] Bumps k8s operation timeout for continuous test runner. --- Framework/KubernetesWorkflow/K8sController.cs | 13 ++++--------- Tests/CodexContinuousTests/EntryPointFactory.cs | 4 ++-- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/Framework/KubernetesWorkflow/K8sController.cs b/Framework/KubernetesWorkflow/K8sController.cs index 3f5504f..cdd906e 100644 --- a/Framework/KubernetesWorkflow/K8sController.cs +++ b/Framework/KubernetesWorkflow/K8sController.cs @@ -32,7 +32,7 @@ namespace KubernetesWorkflow public RunningPod BringOnline(ContainerRecipe[] containerRecipes, ILocation location) { log.Debug(); - EnsureTestNamespace(); + EnsureNamespace(); var deploymentName = CreateDeployment(containerRecipes, location); var (serviceName, servicePortsMap) = CreateService(containerRecipes); @@ -90,7 +90,7 @@ namespace KubernetesWorkflow public void DeleteNamespace() { log.Debug(); - if (IsTestNamespaceOnline()) + if (IsNamespaceOnline(K8sNamespace)) { client.Run(c => c.DeleteNamespace(K8sNamespace, null, null, gracePeriodSeconds: 0)); } @@ -134,9 +134,9 @@ namespace KubernetesWorkflow private string K8sNamespace { get; } - private void EnsureTestNamespace() + private void EnsureNamespace() { - if (IsTestNamespaceOnline()) return; + if (IsNamespaceOnline(K8sNamespace)) return; var namespaceSpec = new V1Namespace { @@ -153,11 +153,6 @@ namespace KubernetesWorkflow CreatePolicy(); } - private bool IsTestNamespaceOnline() - { - return IsNamespaceOnline(K8sNamespace); - } - private bool IsNamespaceOnline(string name) { return client.Run(c => c.ListNamespace().Items.Any(n => n.Metadata.Name == name)); diff --git a/Tests/CodexContinuousTests/EntryPointFactory.cs b/Tests/CodexContinuousTests/EntryPointFactory.cs index 90b92b4..9f4388e 100644 --- a/Tests/CodexContinuousTests/EntryPointFactory.cs +++ b/Tests/CodexContinuousTests/EntryPointFactory.cs @@ -19,8 +19,8 @@ namespace ContinuousTests var lifecycleConfig = new KubernetesWorkflow.Configuration ( kubeConfigFile: kubeConfig, - operationTimeout: TimeSpan.FromSeconds(30), - retryDelay: TimeSpan.FromSeconds(10), + operationTimeout: TimeSpan.FromMinutes(2), + retryDelay: TimeSpan.FromSeconds(30), kubernetesNamespace: customNamespace );