Skip to content

Commit

Permalink
Induce failure to get GC logs before upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mgencur committed Aug 29, 2023
1 parent fc87cce commit 125c2b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/upgrade/kitchensink/kitchensink_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"log"
"math/rand"
"os"
"runtime"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -288,8 +287,7 @@ func VerifyMemoryUsage(ctx *test.Context, systemPodsMemory map[string]float64) p
}

func recordMemoryUsage(t *testing.T, ctx *test.Context, systemPodsMemory map[string]float64) {
// Force garbage collection before checking memory usage.
runtime.GC()
time.Sleep(7 * time.Minute)

prometheusCtx := context.WithValue(context.Background(), client.Key{}, ctx.Clients.Kube)
prometheusCtx = context.WithValue(prometheusCtx, dynamicclient.Key{}, ctx.Clients.Dynamic)
Expand Down Expand Up @@ -324,4 +322,6 @@ func recordMemoryUsage(t *testing.T, ctx *test.Context, systemPodsMemory map[str
systemPodsMemory[component] = systemPodsMemory[component] + float64(sample.Value)
}
}

ctx.T.Fatal("Induced failure")
}

0 comments on commit 125c2b5

Please sign in to comment.