Skip to content

Commit 17eeefa

Browse files
dbasunagsheltoncyril
authored andcommitted
Use wait_for_pods_by_labels() instead of direct api call (opendatahub-io#646)
1 parent 9a8b631 commit 17eeefa

1 file changed

Lines changed: 6 additions & 9 deletions

File tree

tests/model_registry/conftest.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,12 @@ def model_registry_deployment_containers(model_registry_namespace: str) -> list[
320320

321321
@pytest.fixture(scope="class")
322322
def model_registry_pod(admin_client: DynamicClient, model_registry_namespace: str) -> Pod:
323-
mr_pod = list(
324-
Pod.get(
325-
dyn_client=admin_client,
326-
namespace=model_registry_namespace,
327-
label_selector=MODEL_REGISTRY_POD_FILTER,
328-
)
329-
)
330-
assert len(mr_pod) == 1
331-
return mr_pod[0]
323+
return wait_for_pods_by_labels(
324+
admin_client=admin_client,
325+
namespace=model_registry_namespace,
326+
label_selector=MODEL_REGISTRY_POD_FILTER,
327+
expected_num_pods=1,
328+
)[0]
332329

333330

334331
@pytest.fixture(scope="class")

0 commit comments

Comments
 (0)