From f7fac330f5c172bfb0ede76dc53db396575775d4 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Mon, 3 Apr 2023 10:55:37 -0700 Subject: [PATCH 1/2] Fix typo that prevented compiling with Go 1.19 --- .../tlsassertions/assertions_before_go1.20.go | 2 +- .../testutil/tlsassertions/assertions_test.go | 22 ------------------- 2 files changed, 1 insertion(+), 23 deletions(-) delete mode 100644 internal/testutil/tlsassertions/assertions_test.go diff --git a/internal/testutil/tlsassertions/assertions_before_go1.20.go b/internal/testutil/tlsassertions/assertions_before_go1.20.go index f710dba8..ce94fc07 100644 --- a/internal/testutil/tlsassertions/assertions_before_go1.20.go +++ b/internal/testutil/tlsassertions/assertions_before_go1.20.go @@ -5,6 +5,6 @@ package tlsassertions -func GetTlsErrorPrefix() string { +func GetTLSErrorPrefix() string { return "" } diff --git a/internal/testutil/tlsassertions/assertions_test.go b/internal/testutil/tlsassertions/assertions_test.go deleted file mode 100644 index 706fb21d..00000000 --- a/internal/testutil/tlsassertions/assertions_test.go +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2023 the Pinniped contributors. All Rights Reserved. -// SPDX-License-Identifier: Apache-2.0 - -package tlsassertions - -import ( - "runtime" - "strings" - "testing" - - "github.com/stretchr/testify/require" -) - -func TestGetTLSErrorPrefix(t *testing.T) { - expected := "tls: failed to verify certificate: " - - if strings.Contains(runtime.Version(), "1.19") { - expected = "" - } - - require.Equal(t, expected, GetTLSErrorPrefix()) -} From a04129548f6a659f297dc3a42e3c76de513aaa64 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Mon, 3 Apr 2023 11:45:31 -0700 Subject: [PATCH 2/2] Increase some test timeouts that failed once on Kind jobs in CI --- test/integration/supervisor_oidc_client_test.go | 6 +++--- test/integration/supervisor_oidcclientsecret_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/test/integration/supervisor_oidc_client_test.go b/test/integration/supervisor_oidc_client_test.go index 382caa4c..9a80697d 100644 --- a/test/integration/supervisor_oidc_client_test.go +++ b/test/integration/supervisor_oidc_client_test.go @@ -1,4 +1,4 @@ -// Copyright 2022 the Pinniped contributors. All Rights Reserved. +// Copyright 2022-2023 the Pinniped contributors. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package integration @@ -34,7 +34,7 @@ func TestOIDCClientStaticValidation_Parallel(t *testing.T) { groupFix := strings.NewReplacer(".supervisor.pinniped.dev", ".supervisor."+env.APIGroupSuffix) errFix := strings.NewReplacer(makeErrFix(reallyOld)...) - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) t.Cleanup(cancel) namespaceClient := adminClient.CoreV1().Namespaces() @@ -516,7 +516,7 @@ func makeErrFix(reallyOld bool) []string { func TestOIDCClientControllerValidations_Parallel(t *testing.T) { env := testlib.IntegrationEnv(t) - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) t.Cleanup(cancel) secrets := testlib.NewKubernetesClientset(t).CoreV1().Secrets(env.SupervisorNamespace) diff --git a/test/integration/supervisor_oidcclientsecret_test.go b/test/integration/supervisor_oidcclientsecret_test.go index 0ba2c42c..753527d9 100644 --- a/test/integration/supervisor_oidcclientsecret_test.go +++ b/test/integration/supervisor_oidcclientsecret_test.go @@ -211,7 +211,7 @@ func TestKubectlOIDCClientSecretRequest_Parallel(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 13*time.Minute) t.Cleanup(cancel) supervisorClient := testlib.NewSupervisorClientset(t) @@ -877,7 +877,7 @@ func TestCreateOIDCClientSecretRequest_Parallel(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 13*time.Minute) t.Cleanup(cancel) kubeClient := testlib.NewKubernetesClientset(t) @@ -1020,7 +1020,7 @@ func prependSecret(list []string, newItem string) []string { func TestOIDCClientSecretRequestUnauthenticated_Parallel(t *testing.T) { env := testlib.IntegrationEnv(t) - ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 3*time.Minute) t.Cleanup(cancel) client := testlib.NewAnonymousSupervisorClientset(t)