Skip to content
Merged
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: 9 additions & 1 deletion test/e2e/karpenter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,9 +672,11 @@ func testNodeClassVersionField(ctx context.Context, mgtClient, guestClient crcli
instanceID, instance.MetadataOptions.HttpTokens, instance.MetadataOptions.HttpEndpoint, *instance.MetadataOptions.HttpPutResponseHopLimit)
}

// Trigger cleanup; the t.Cleanup handles final deletion.
// Trigger cleanup and wait for nodes to fully terminate so stale
// NodeClaims don't leak vCPUs into subsequent sequential tests.
g.Expect(guestClient.Delete(ctx, testWorkLoads)).To(Succeed())
g.Expect(guestClient.Delete(ctx, testNodePool)).To(Succeed())
_ = e2eutil.WaitForReadyNodesByLabels(t, ctx, guestClient, hostedCluster.Spec.Platform.Type, 0, testNodeLabels)

// Verify that a version exceeding the allowed n-3 skew sets SupportedVersionSkew=False.
skewMajor, skewMinor, err := supportedversion.PreviousMinorVersion(cpVersion, 4)
Expand Down Expand Up @@ -887,6 +889,12 @@ func testCapacityReservation(ctx context.Context, mgtClient, guestClient crclien
g.Expect(aws.ToString(instance.CapacityReservationId)).To(Equal(crID),
"instance %s should have been launched into capacity reservation %s", instanceID, crID)
t.Logf("Instance %s correctly launched into capacity reservation %s", instanceID, crID)

// Delete workload and NodePool, then wait for nodes to fully terminate
// so stale NodeClaims don't leak vCPUs into subsequent sequential tests.
g.Expect(guestClient.Delete(ctx, crWorkload)).To(Succeed())
g.Expect(guestClient.Delete(ctx, crNodePool)).To(Succeed())
_ = e2eutil.WaitForReadyNodesByLabels(t, ctx, guestClient, hostedCluster.Spec.Platform.Type, 0, crNodeLabels)
}
}

Expand Down