From a32f44a6338b2dee4b2043abe84ce75862685054 Mon Sep 17 00:00:00 2001 From: mvlassis Date: Tue, 9 Jul 2024 13:10:16 +0300 Subject: [PATCH] Expand test for recurring runs --- tests/integration/test_kfp_functional_v1.py | 13 ++++++++++++- tests/integration/test_kfp_functional_v2.py | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_kfp_functional_v1.py b/tests/integration/test_kfp_functional_v1.py index fa555270..566d6977 100644 --- a/tests/integration/test_kfp_functional_v1.py +++ b/tests/integration/test_kfp_functional_v1.py @@ -192,8 +192,19 @@ async def test_create_and_monitor_recurring_run( assert recurring_job.trigger.cron_schedule.cron == "*/2 * * * * *" # Wait for the recurring job to schedule some runs - time.sleep(6) + time.sleep(30) + first_run = kfp_client.list_runs(experiment_id=experiment_response.experiment_id, + namespace=KUBEFLOW_PROFILE_NAMESPACE).runs[0] + + # Assert that a run has been created from the recurring job + assert first_run.recurring_run_id == recurring_job.recurring_run_id + + # Monitor the run to completion, the pipeline should not be executed in + # more than 300 seconds as it is a very simple operation + monitor_response = kfp_client.wait_for_run_completion(first_run.run_id, timeout=600) + assert monitor_response.state == "SUCCEEDED" + # FIXME: disabling the job does not work at the moment, it seems like # the status of the recurring run is never updated and is causing the # following assertion to fail diff --git a/tests/integration/test_kfp_functional_v2.py b/tests/integration/test_kfp_functional_v2.py index 1fb15274..5b7679f5 100644 --- a/tests/integration/test_kfp_functional_v2.py +++ b/tests/integration/test_kfp_functional_v2.py @@ -188,7 +188,18 @@ async def test_create_and_monitor_recurring_run( assert recurring_job.trigger.cron_schedule.cron == "*/2 * * * * *" # Wait for the recurring job to schedule some runs - time.sleep(6) + time.sleep(30) + + first_run = kfp_client.list_runs(experiment_id=experiment_response.experiment_id, + namespace=KUBEFLOW_PROFILE_NAMESPACE).runs[0] + + # Assert that a run has been created from the recurring job + assert first_run.recurring_run_id == recurring_job.recurring_run_id + + # Monitor the run to completion, the pipeline should not be executed in + # more than 300 seconds as it is a very simple operation + monitor_response = kfp_client.wait_for_run_completion(first_run.run_id, timeout=600) + assert monitor_response.state == "SUCCEEDED" # FIXME: disabling the job does not work at the moment, it seems like # the status of the recurring run is never updated and is causing the