From 1510181ecee0cbec73adb4023da63117c4c1d55b Mon Sep 17 00:00:00 2001 From: Nedyalko Dyakov Date: Tue, 28 Oct 2025 15:43:58 +0200 Subject: [PATCH] allow e2e tests to run longer --- maintnotifications/e2e/main_test.go | 3 +++ maintnotifications/e2e/scenario_endpoint_types_test.go | 2 +- maintnotifications/e2e/scenario_push_notifications_test.go | 5 +++-- maintnotifications/e2e/scenario_stress_test.go | 2 +- maintnotifications/e2e/scenario_tls_configs_test.go | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/maintnotifications/e2e/main_test.go b/maintnotifications/e2e/main_test.go index 5b1d6c94..ba24303d 100644 --- a/maintnotifications/e2e/main_test.go +++ b/maintnotifications/e2e/main_test.go @@ -4,6 +4,7 @@ import ( "log" "os" "testing" + "time" "github.com/redis/go-redis/v9" "github.com/redis/go-redis/v9/logging" @@ -12,6 +13,8 @@ import ( // Global log collector var logCollector *TestLogCollector +const defaultTestTimeout = 30 * time.Minute + // Global fault injector client var faultInjector *FaultInjectorClient diff --git a/maintnotifications/e2e/scenario_endpoint_types_test.go b/maintnotifications/e2e/scenario_endpoint_types_test.go index 57bd9439..90115ecb 100644 --- a/maintnotifications/e2e/scenario_endpoint_types_test.go +++ b/maintnotifications/e2e/scenario_endpoint_types_test.go @@ -21,7 +21,7 @@ func TestEndpointTypesPushNotifications(t *testing.T) { t.Skip("Scenario tests require E2E_SCENARIO_TESTS=true") } - ctx, cancel := context.WithTimeout(context.Background(), 25*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() var dump = true diff --git a/maintnotifications/e2e/scenario_push_notifications_test.go b/maintnotifications/e2e/scenario_push_notifications_test.go index ffe74ace..ccc648b0 100644 --- a/maintnotifications/e2e/scenario_push_notifications_test.go +++ b/maintnotifications/e2e/scenario_push_notifications_test.go @@ -19,7 +19,7 @@ func TestPushNotifications(t *testing.T) { t.Skip("Scenario tests require E2E_SCENARIO_TESTS=true") } - ctx, cancel := context.WithTimeout(context.Background(), 15*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() // Setup: Create fresh database and client factory for this test @@ -395,8 +395,9 @@ func TestPushNotifications(t *testing.T) { p("Executing commands and collecting logs for analysis... This will take 30 seconds...") go commandsRunner.FireCommandsUntilStop(ctx) - time.Sleep(30 * time.Second) + time.Sleep(time.Minute) commandsRunner.Stop() + time.Sleep(time.Minute) allLogsAnalysis := logCollector.GetAnalysis() trackerAnalysis := tracker.GetAnalysis() diff --git a/maintnotifications/e2e/scenario_stress_test.go b/maintnotifications/e2e/scenario_stress_test.go index 2eea1444..ec069d60 100644 --- a/maintnotifications/e2e/scenario_stress_test.go +++ b/maintnotifications/e2e/scenario_stress_test.go @@ -19,7 +19,7 @@ func TestStressPushNotifications(t *testing.T) { t.Skip("[STRESS][SKIP] Scenario tests require E2E_SCENARIO_TESTS=true") } - ctx, cancel := context.WithTimeout(context.Background(), 35*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), 40*time.Minute) defer cancel() // Setup: Create fresh database and client factory for this test diff --git a/maintnotifications/e2e/scenario_tls_configs_test.go b/maintnotifications/e2e/scenario_tls_configs_test.go index 243ea3b7..673fcacc 100644 --- a/maintnotifications/e2e/scenario_tls_configs_test.go +++ b/maintnotifications/e2e/scenario_tls_configs_test.go @@ -20,7 +20,7 @@ func ТestTLSConfigurationsPushNotifications(t *testing.T) { t.Skip("Scenario tests require E2E_SCENARIO_TESTS=true") } - ctx, cancel := context.WithTimeout(context.Background(), 25*time.Minute) + ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) defer cancel() var dump = true