Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions operator/e2e/tests/scale/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"os"
"strconv"
"testing"
"time"

"github.com/ai-dynamo/grove/operator/e2e/k8s/k8sclient"
"github.com/ai-dynamo/grove/operator/e2e/measurement"
Expand Down Expand Up @@ -64,6 +65,15 @@ func TestMain(m *testing.M) {

code := m.Run()

// Perform a final cascading cleanup before tearing down the cluster to prevent
// resource leakage when the cluster is reused for subsequent tests.
// We use a 5-minute timeout as a safe upper bound; internal operations have their own stricter timeouts.
cleanupCtx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
if err := sharedCluster.CleanupWorkloads(cleanupCtx, true); err != nil {
Logger.Errorf("Final cascading cleanup failed: %v", err)
}

sharedCluster.Teardown()

os.Exit(code)
Expand Down
Loading