From fa09aa2a39da8ee9aa27b1d58e4582ed6ddfdf67 Mon Sep 17 00:00:00 2001 From: Alexander Block Date: Mon, 25 Apr 2022 14:28:10 +0200 Subject: [PATCH] tests: Use proper timeouts in gitrepository and helmrepository tests I assume using "interval" for timeouts was an accident and "timeout" was actually meant to be used. This also fixes flakiness of tests. Signed-off-by: Alexander Block --- controllers/gitrepository_controller_test.go | 6 +++--- controllers/helmrepository_controller_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/controllers/gitrepository_controller_test.go b/controllers/gitrepository_controller_test.go index c0ac4606..fb020d7c 100644 --- a/controllers/gitrepository_controller_test.go +++ b/controllers/gitrepository_controller_test.go @@ -434,7 +434,7 @@ func TestGitRepositoryReconciler_reconcileSource_authStrategy(t *testing.T) { }, Spec: sourcev1.GitRepositorySpec{ Interval: metav1.Duration{Duration: interval}, - Timeout: &metav1.Duration{Duration: interval}, + Timeout: &metav1.Duration{Duration: timeout}, }, } @@ -653,7 +653,7 @@ func TestGitRepositoryReconciler_reconcileSource_checkoutStrategy(t *testing.T) }, Spec: sourcev1.GitRepositorySpec{ Interval: metav1.Duration{Duration: interval}, - Timeout: &metav1.Duration{Duration: interval}, + Timeout: &metav1.Duration{Duration: timeout}, URL: server.HTTPAddress() + repoPath, Reference: tt.reference, }, @@ -1517,7 +1517,7 @@ func TestGitRepositoryReconciler_ConditionsUpdate(t *testing.T) { URL: server.HTTPAddress() + repoPath, GitImplementation: sourcev1.GoGitImplementation, Interval: metav1.Duration{Duration: interval}, - Timeout: &metav1.Duration{Duration: interval}, + Timeout: &metav1.Duration{Duration: timeout}, }, } diff --git a/controllers/helmrepository_controller_test.go b/controllers/helmrepository_controller_test.go index 7a1e5d59..97934d50 100644 --- a/controllers/helmrepository_controller_test.go +++ b/controllers/helmrepository_controller_test.go @@ -440,7 +440,7 @@ func TestHelmRepositoryReconciler_reconcileSource(t *testing.T) { }, Spec: sourcev1.HelmRepositorySpec{ Interval: metav1.Duration{Duration: interval}, - Timeout: &metav1.Duration{Duration: interval}, + Timeout: &metav1.Duration{Duration: timeout}, }, }