Skip to content

Commit c74156f

Browse files
committed
use different port than the one in env
1 parent 13c5092 commit c74156f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

maintnotifications/e2e/config_parser_test.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"crypto/tls"
66
"encoding/json"
77
"fmt"
8+
"math/rand"
89
"net/url"
910
"os"
1011
"strconv"
@@ -517,16 +518,18 @@ func ConvertEnvDatabaseConfigToFaultInjectorConfig(envConfig EnvDatabaseConfig,
517518
return DatabaseConfig{}, fmt.Errorf("invalid port: %w", err)
518519
}
519520
} else {
520-
port = 6379 // default
521+
port = 6379 * 2 // default*2
521522
}
522523
} else {
523524
return DatabaseConfig{}, fmt.Errorf("no endpoints found in configuration")
524525
}
525526

527+
randomPortOffset := 1 + rand.Intn(10) // Random port offset to avoid conflicts
528+
526529
// Build the database config for fault injector
527530
dbConfig := DatabaseConfig{
528531
Name: name,
529-
Port: port,
532+
Port: port + randomPortOffset,
530533
MemorySize: 268435456, // 256MB default
531534
Replication: false,
532535
EvictionPolicy: "noeviction",

0 commit comments

Comments
 (0)