From ea29d03d945774fd0f59d3a3f0e0ae9dbc9de305 Mon Sep 17 00:00:00 2001 From: Yuki Iwai Date: Sun, 7 May 2023 23:51:50 +0900 Subject: [PATCH] Improve E2E tests for the gang-scheduling 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