You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2019/12/20 09:29:47 UTC

[camel-k] 02/02: chore(test): give some time on operator scale down to fix flacky tests

This is an automated email from the ASF dual-hosted git repository.

nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git

commit ab3d996eeb817be8482ba039280011707340a3d1
Author: Nicola Ferraro <ni...@gmail.com>
AuthorDate: Fri Dec 20 09:57:15 2019 +0100

    chore(test): give some time on operator scale down to fix flacky tests
---
 e2e/test_support.go | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/e2e/test_support.go b/e2e/test_support.go
index a05066d..d9f437c 100644
--- a/e2e/test_support.go
+++ b/e2e/test_support.go
@@ -486,10 +486,10 @@ func operatorPod(ns string) func() *corev1.Pod {
 	}
 }
 
-func operatorTryPodForceKill(ns string) {
+func operatorTryPodForceKill(ns string, timeSeconds int) {
 	pod := operatorPod(ns)()
 	if pod != nil {
-		if err := testClient.Delete(testContext, pod, k8sclient.GracePeriodSeconds(0)); err != nil {
+		if err := testClient.Delete(testContext, pod, k8sclient.GracePeriodSeconds(timeSeconds)); err != nil {
 			log.Error(err, "cannot forcefully kill the pod")
 		}
 	}
@@ -526,7 +526,7 @@ func scaleOperator(ns string, replicas int32) func() error {
 
 		if replicas == 0 {
 			// speedup scale down by killing the pod
-			operatorTryPodForceKill(ns)
+			operatorTryPodForceKill(ns, 10)
 		}
 		return nil
 	}