Weekend fun with memory leaks

This commit is contained in:
2025-09-07 03:02:34 +01:00
parent e17b820368
commit c9a23dc6c0
13 changed files with 353 additions and 83 deletions
+2 -7
View File
@@ -203,10 +203,7 @@ func TestGracefulDegradation(t *testing.T) {
config.RecoveryTimeout = 100 * time.Millisecond
gd := NewGracefulDegradation(config, logger)
defer func() {
// Clean up goroutine
time.Sleep(100 * time.Millisecond)
}()
defer gd.Close()
t.Run("Register fallback and health check", func(t *testing.T) {
gd.RegisterFallback("test-service", func() (interface{}, error) {
@@ -819,9 +816,7 @@ func TestGracefulDegradationConcurrent(t *testing.T) {
EnableFallbacks: true,
}
gd := NewGracefulDegradation(config, logger)
defer func() {
time.Sleep(150 * time.Millisecond) // Allow cleanup
}()
defer gd.Close()
var wg sync.WaitGroup
var registrationWG sync.WaitGroup