Skip to content

Commit fb8f057

Browse files
committed
Conformance: Updates InferencePoolResolvedRefsCondition Test
Signed-off-by: Daneyon Hansen <[email protected]>
1 parent dd6834a commit fb8f057

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

conformance/tests/inferencepool_resolvedrefs_condition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ var InferencePoolParentStatus = suite.ConformanceTest{
152152
t.Logf("Waiting for %v for Gateway conditions to update after deleting HTTPRoute %s", inferenceTimeoutConfig.HTTPRouteDeletionReconciliationTimeout, httpRouteSecondaryNN.String())
153153
time.Sleep(inferenceTimeoutConfig.HTTPRouteDeletionReconciliationTimeout)
154154

155-
k8sutils.InferencePoolMustHaveNoParents(t, s.Client, poolNN)
155+
k8sutils.InferencePoolMustHaveDefaultParent(t, s.Client, poolNN)
156156
t.Logf("InferencePool %s correctly shows no parent statuses, indicating it's no longer referenced.", poolNN.String())
157157

158158
trafficutils.MakeRequestAndExpectEventuallyConsistentResponse(

conformance/utils/kubernetes/helpers.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,10 @@ func InferencePoolMustHaveCondition(t *testing.T, c client.Reader, poolNN types.
160160
t.Log(logMsg)
161161
}
162162

163-
// InferencePoolMustHaveNoParents waits for the specified InferencePool resource
164-
// to exist and report that it has no parent references in its status.
165-
// This typically indicates it is no longer referenced by any Gateway API resources.
166-
func InferencePoolMustHaveNoParents(t *testing.T, c client.Reader, poolNN types.NamespacedName) {
163+
// InferencePoolMustHaveDefaultParent waits for the specified InferencePool resource
164+
// to exist and report that it contains the default parent references in its status.
165+
// This indicates no controller is managing the resource.
166+
func InferencePoolMustHaveDefaultParent(t *testing.T, c client.Reader, poolNN types.NamespacedName) {
167167
t.Helper()
168168

169169
var lastObservedPool *inferenceapi.InferencePool
@@ -193,8 +193,15 @@ func InferencePoolMustHaveNoParents(t *testing.T, c client.Reader, poolNN types.
193193
lastObservedPool = pool
194194
lastError = nil
195195

196-
if len(pool.Status.Parents) == 0 {
197-
t.Logf("InferencePool %s successfully has no parent statuses.", poolNN.String())
196+
if len(pool.Status.Parents) == 1 &&
197+
pool.Status.Parents[0].GatewayRef.Name == "default" &&
198+
pool.Status.Parents[0].Conditions != nil &&
199+
checkCondition(t, pool.Status.Parents[0].Conditions, metav1.Condition{
200+
Type: string(gatewayv1.GatewayConditionAccepted),
201+
Status: "Unknown",
202+
Reason: string(inferenceapi.InferencePoolReasonPending),
203+
}) {
204+
t.Logf("InferencePool %s successfully has the default parent statuses.", poolNN.String())
198205
return true, nil
199206
}
200207
t.Logf("InferencePool %s still has %d parent statuses. Waiting...", poolNN.String(), len(pool.Status.Parents))

0 commit comments

Comments
 (0)