Skip to content

Commit 4b9668e

Browse files
committed
remove unused fault injector mock
1 parent 0f908f6 commit 4b9668e

File tree

6 files changed

+28
-108
lines changed

6 files changed

+28
-108
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ coverage.txt
99
**/coverage.txt
1010
.vscode
1111
tmp/*
12+
*.test
1213

1314
# maintenanceNotifications upgrade documentation (temporary)
1415
maintenanceNotifications/docs/

maintnotifications/e2e/cmd/fault-injector-server/main.go

Lines changed: 0 additions & 103 deletions
This file was deleted.

maintnotifications/e2e/doc.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Package e2e provides end-to-end testing scenarios for the maintenance notifications system.
2+
//
3+
// This package contains comprehensive test scenarios that validate the maintenance notifications
4+
// functionality in realistic environments. The tests are designed to work with Redis Enterprise
5+
// clusters and require specific environment configuration.
6+
//
7+
// Environment Variables:
8+
// - E2E_SCENARIO_TESTS: Set to "true" to enable scenario tests
9+
// - REDIS_ENDPOINTS_CONFIG_PATH: Path to endpoints configuration file
10+
// - FAULT_INJECTION_API_URL: URL for fault injection API (optional)
11+
//
12+
// Test Scenarios:
13+
// - Basic Push Notifications: Core functionality testing
14+
// - Endpoint Types: Different endpoint resolution strategies
15+
// - Timeout Configurations: Various timeout strategies
16+
// - TLS Configurations: Different TLS setups
17+
// - Stress Testing: Extreme load and concurrent operations
18+
//
19+
// Note: Maintenance notifications are currently supported only in standalone Redis clients.
20+
// Cluster clients (ClusterClient, FailoverClient, etc.) do not yet support this functionality.
21+
package e2e

maintnotifications/handoff_worker.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package maintnotifications
22

33
import (
44
"context"
5-
"fmt"
5+
"errors"
66
"net"
77
"sync"
88
"sync/atomic"
@@ -261,7 +261,7 @@ func (hwm *handoffWorkerManager) queueHandoff(conn *pool.Conn) error {
261261
if internal.LogLevel.InfoOrAbove() {
262262
internal.Logger.Printf(context.Background(), logs.ConnectionNotMarkedForHandoff(conn.GetID()))
263263
}
264-
return fmt.Errorf(logs.ConnectionNotMarkedForHandoffError(conn.GetID()))
264+
return errors.New(logs.ConnectionNotMarkedForHandoffError(conn.GetID()))
265265
}
266266

267267
// Create handoff request with atomically retrieved data

maintnotifications/manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package maintnotifications
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"net"
78
"sync"
@@ -123,7 +124,7 @@ func (hm *Manager) setupPushNotifications() error {
123124
// Register handlers for all upgrade notifications with the client's processor
124125
for _, notificationType := range maintenanceNotificationTypes {
125126
if err := processor.RegisterHandler(notificationType, handler, true); err != nil {
126-
return fmt.Errorf(logs.FailedToRegisterHandler(notificationType, err))
127+
return errors.New(logs.FailedToRegisterHandler(notificationType, err))
127128
}
128129
}
129130

maintnotifications/push_notification_handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package maintnotifications
22

33
import (
44
"context"
5-
"fmt"
5+
"errors"
66
"time"
77

88
"github.com/redis/go-redis/v9/internal"
@@ -154,7 +154,7 @@ func (snh *NotificationHandler) markConnForHandoff(conn *pool.Conn, newEndpoint
154154
// Track the operation (ignore errors since this is optional)
155155
_ = snh.operationsManager.TrackMovingOperationWithConnID(context.Background(), newEndpoint, deadline, seqID, connID)
156156
} else {
157-
return fmt.Errorf(logs.ManagerNotInitialized())
157+
return errors.New(logs.ManagerNotInitialized())
158158
}
159159
return nil
160160
}

0 commit comments

Comments
 (0)