From 485b1fb9f3273b8e2f624cef48f370d32f620cad Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Thu, 11 May 2023 19:30:01 +0900 Subject: [PATCH] Improve E2E tests for the gang-scheduling (#1801) Signed-off-by: Yuki Iwai --- sdk/python/test/e2e/utils.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/sdk/python/test/e2e/utils.py b/sdk/python/test/e2e/utils.py index 65ab38d3b0..cd9223ba46 100644 --- a/sdk/python/test/e2e/utils.py +++ b/sdk/python/test/e2e/utils.py @@ -17,15 +17,14 @@ def verify_unschedulable_job_e2e( logging.info(f"\n\n\n{job_kind} is creating") client.wait_for_job_conditions(name, namespace, job_kind, {constants.JOB_CONDITION_CREATED}) - # Job should have Created conditions. - conditions = client.get_job_conditions(name, namespace, job_kind) - if len(conditions) != 1: - raise Exception(f"{job_kind} conditions are invalid: {conditions}") - - # Job should have correct conditions. + # Job should have a Created condition. if not client.is_job_created(name, namespace, job_kind): raise Exception(f"{job_kind} should be in Created condition") + # Job shouldn't have a Running condition. + if client.is_job_running(name, namespace, job_kind): + raise Exception(f"{job_kind} shouldn't be in Running condition") + def verify_job_e2e( client: TrainingClient, name: str, namespace: str, job_kind: str, container: str, timeout: int = 600