From 69409e498111919bbf5a45573a7370e84bb8a7eb Mon Sep 17 00:00:00 2001 From: ZKpLo <14148880+zkplo@user.noreply.gitee.com> Date: Wed, 20 Nov 2024 15:34:17 +0800 Subject: [PATCH] [INLONG-11400][Manager] Fix UT --- .../manager/schedule/airflow/AirflowContainerEnv.java | 6 ++++++ .../manager/schedule/airflow/AirflowScheduleEngineTest.java | 6 ++++++ .../src/main/resources/application-dev.properties | 1 - 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/airflow/AirflowContainerEnv.java b/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/airflow/AirflowContainerEnv.java index 2e7d467581..f99282a2ed 100644 --- a/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/airflow/AirflowContainerEnv.java +++ b/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/airflow/AirflowContainerEnv.java @@ -69,6 +69,12 @@ public static void setUp() { log.info("Airflow runtime environment created successfully."); } + public static void shutDown() { + if (environment != null) { + environment.stop(); + } + } + private static void copyTestDAGs() { // After the DAG file is created, the scheduler will regularly scan the DAG file directory and // then load it into memory for scheduling. In order to quickly test the update and unregister, two diff --git a/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/airflow/AirflowScheduleEngineTest.java b/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/airflow/AirflowScheduleEngineTest.java index 2e4213f56f..fe5d070afd 100644 --- a/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/airflow/AirflowScheduleEngineTest.java +++ b/inlong-manager/manager-schedule/src/test/java/org/apache/inlong/manager/schedule/airflow/AirflowScheduleEngineTest.java @@ -21,6 +21,7 @@ import org.apache.inlong.manager.schedule.BaseScheduleTest; import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Order; import org.junit.jupiter.api.Test; @@ -54,6 +55,11 @@ public static void initScheduleEngine() { } } + @AfterAll + public static void stopScheduleEngine() { + AirflowContainerEnv.shutDown(); + } + @Test @Order(1) public void testRegisterScheduleInfo() { diff --git a/inlong-manager/manager-web/src/main/resources/application-dev.properties b/inlong-manager/manager-web/src/main/resources/application-dev.properties index 3b1651a7f0..fa8704fa14 100644 --- a/inlong-manager/manager-web/src/main/resources/application-dev.properties +++ b/inlong-manager/manager-web/src/main/resources/application-dev.properties @@ -114,7 +114,6 @@ dirty.dirty.db.table=inlong_iceberg::dirty_data_achive_iceberg schedule.engine.dolphinscheduler.url=http://127.0.0.1:12345/dolphinscheduler schedule.engine.dolphinscheduler.token=default_token_value - # Airflow configuration schedule.engine.airflow.baseUrl= schedule.engine.airflow.username=