From a84f60277618a4c13a9902ef3f6c9c82c1e8f97a Mon Sep 17 00:00:00 2001 From: Carlos Date: Mon, 9 Oct 2023 14:29:50 -0300 Subject: [PATCH] Unify 15s timeout in the end of tests Small reduction. Seems enough for CI as well. --- end-to-end/manual_token_input_test.go | 5 +++-- end-to-end/organization_token_test.go | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/end-to-end/manual_token_input_test.go b/end-to-end/manual_token_input_test.go index 120a49865..64f0a6d57 100644 --- a/end-to-end/manual_token_input_test.go +++ b/end-to-end/manual_token_input_test.go @@ -67,10 +67,11 @@ func TestManualTokenInput(t *testing.T) { require.NoErrorf(t, err, "Setup: could not wake distro up: %v. %s", err, out) } - maxTimeout := 15 * time.Second + const maxTimeout = 15 * time.Second + if !tc.wantAttached { time.Sleep(maxTimeout) - proCtx, cancel := context.WithTimeout(ctx, 5*time.Second) + proCtx, cancel := context.WithTimeout(ctx, maxTimeout) defer cancel() attached, err := distroIsProAttached(t, proCtx, d) require.NoError(t, err, "could not determine if distro is attached") diff --git a/end-to-end/organization_token_test.go b/end-to-end/organization_token_test.go index d8c85e4d2..fb5c86467 100644 --- a/end-to-end/organization_token_test.go +++ b/end-to-end/organization_token_test.go @@ -67,11 +67,11 @@ func TestOrganizationProvidedToken(t *testing.T) { require.NoErrorf(t, err, "Setup: could not wake distro up: %v. %s", err, out) } - const maxTimeout = 30 * time.Second + const maxTimeout = 15 * time.Second if !tc.wantAttached { time.Sleep(maxTimeout) - proCtx, cancel := context.WithTimeout(ctx, 5*time.Second) + proCtx, cancel := context.WithTimeout(ctx, maxTimeout) defer cancel() attached, err := distroIsProAttached(t, proCtx, d) require.NoError(t, err, "could not determine if distro is attached")