@@ -191,6 +191,8 @@ func RunConformance(t *testing.T) {
191
191
// RunConformanceWithOptions runs the Inference Extension conformance tests with specific options.
192
192
func RunConformanceWithOptions (t * testing.T , opts confsuite.ConformanceOptions ) {
193
193
t .Helper ()
194
+ ctx := context .Background ()
195
+
194
196
t .Logf ("Running Inference Extension conformance tests with GatewayClass %s" , opts .GatewayClassName )
195
197
logDebugf (t , opts .Debug , "RunConformanceWithOptions: BaseManifests path being used by opts: %q" , opts .BaseManifests )
196
198
@@ -204,7 +206,7 @@ func RunConformanceWithOptions(t *testing.T, opts confsuite.ConformanceOptions)
204
206
require .NoError (t , err , "error initializing conformance suite" )
205
207
206
208
installedCRDs := & apiextensionsv1.CustomResourceDefinitionList {}
207
- err = opts .Client .List (context . TODO () , installedCRDs )
209
+ err = opts .Client .List (ctx , installedCRDs )
208
210
require .NoError (t , err , "error getting installedCRDs" )
209
211
apiVersion , err := getGatewayInferenceExtentionVersion (installedCRDs .Items )
210
212
if err != nil {
@@ -214,7 +216,7 @@ func RunConformanceWithOptions(t *testing.T, opts confsuite.ConformanceOptions)
214
216
require .NoError (t , err , "error getting the gateway ineference extension version" )
215
217
}
216
218
}
217
- SetupConformanceTestSuite (t , cSuite , opts , tests .ConformanceTests )
219
+ SetupConformanceTestSuite (ctx , t , cSuite , opts , tests .ConformanceTests )
218
220
t .Log ("Running Inference Extension conformance tests against all registered tests" )
219
221
err = cSuite .Run (t , tests .ConformanceTests )
220
222
require .NoError (t , err , "error running conformance tests" )
@@ -232,7 +234,7 @@ func RunConformanceWithOptions(t *testing.T, opts confsuite.ConformanceOptions)
232
234
}
233
235
}
234
236
235
- func SetupConformanceTestSuite (t * testing.T , suite * confsuite.ConformanceTestSuite , opts confsuite.ConformanceOptions , tests []confsuite.ConformanceTest ) {
237
+ func SetupConformanceTestSuite (ctx context. Context , t * testing.T , suite * confsuite.ConformanceTestSuite , opts confsuite.ConformanceOptions , tests []confsuite.ConformanceTest ) {
236
238
suite .Applier .ManifestFS = suite .ManifestFS
237
239
if suite .RunTest != "" {
238
240
idx := slices .IndexFunc (tests , func (t confsuite.ConformanceTest ) bool {
@@ -260,8 +262,8 @@ func SetupConformanceTestSuite(t *testing.T, suite *confsuite.ConformanceTestSui
260
262
}
261
263
apikubernetes .NamespacesMustBeReady (t , suite .Client , suite .TimeoutConfig , namespaces )
262
264
263
- ensureGatewayAvailableAndReady (t , suite .Client , opts , resources .PrimaryGatewayNN )
264
- ensureGatewayAvailableAndReady (t , suite .Client , opts , resources .SecondaryGatewayNN )
265
+ ensureGatewayAvailableAndReady (ctx , t , suite .Client , opts , resources .PrimaryGatewayNN )
266
+ ensureGatewayAvailableAndReady (ctx , t , suite .Client , opts , resources .SecondaryGatewayNN )
265
267
}
266
268
267
269
func getGatewayInferenceExtentionVersion (crds []apiextensionsv1.CustomResourceDefinition ) (string , error ) {
@@ -284,7 +286,7 @@ func getGatewayInferenceExtentionVersion(crds []apiextensionsv1.CustomResourceDe
284
286
285
287
// ensureGatewayAvailableAndReady polls for the specified Gateway to exist and become ready
286
288
// with an address and programmed condition.
287
- func ensureGatewayAvailableAndReady (t * testing.T , k8sClient client.Client , opts confsuite.ConformanceOptions , gatewayNN types.NamespacedName ) {
289
+ func ensureGatewayAvailableAndReady (ctx context. Context , t * testing.T , k8sClient client.Client , opts confsuite.ConformanceOptions , gatewayNN types.NamespacedName ) {
288
290
t .Helper ()
289
291
290
292
t .Logf ("Attempting to fetch Gateway %s/%s." , gatewayNN .Namespace , gatewayNN .Name )
@@ -298,7 +300,6 @@ func ensureGatewayAvailableAndReady(t *testing.T, k8sClient client.Client, opts
298
300
299
301
logDebugf (t , opts .Debug , "Waiting up to %v for Gateway object %s/%s to appear after manifest application..." , waitForGatewayCreationTimeout , gatewayNN .Namespace , gatewayNN .Name )
300
302
301
- ctx := context .TODO ()
302
303
pollErr := wait .PollUntilContextTimeout (ctx , extTimeoutConf .GatewayObjectPollInterval , waitForGatewayCreationTimeout , true , func (pollCtx context.Context ) (bool , error ) {
303
304
fetchErr := k8sClient .Get (pollCtx , gatewayNN , gw )
304
305
if fetchErr == nil {
0 commit comments