This is an automated email from the ASF dual-hosted git repository.

CRZbulabula pushed a commit to branch speedup-ainode-it
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 9e8568d170d0b0e8e16a4ec11e6e02ecd9b31ebb
Author: Yongzao <[email protected]>
AuthorDate: Tue May 19 12:05:15 2026 +0800

    Speed up AINode IT and split CPU-only tests off GPU runner
    
    Two-tier isolation for org.apache.iotdb.ainode.it so that only the
    GPU-bound tests need a self-hosted GPU runner:
    
    - New AINodeIT category for tests that exercise only metadata/lifecycle
      paths (SHOW/DROP builtin model, REMOVE AINODE). These tests run on a
      plain ubuntu-latest runner via the new AINodeIT Maven profile and
      cluster-it-ainode-cpu.yml workflow.
    - AIClusterIT profile keeps tests that drive CALL INFERENCE, FORECAST,
      or LOAD MODEL TO DEVICES (CUDA), still running on the GPU runner.
    - AINodeBasicIT collects the 4 metadata tests previously mixed into
      AINodeSharedClusterIT; AINodeClusterConfigIT is re-tagged to AINodeIT.
    - AINodeWrapper now tolerates a missing /data/ainode/models cache, so
      CPU runners can boot AINode without the multi-GB weight bundle. When
      the cache is present, weights are symlinked instead of copied per fork
      to remove a large per-test-class IO cost.
    
    Additional speedups in the GPU pipeline:
    
    - AINodeConcurrentForecastIT loop count 100 -> 10 (still 100 reqs per
      model for a concurrency smoke check; nightly can dial up).
    - AINodeTestUtils.prepareDataInTree/Table/Table2 and
      AINodeConcurrentForecastIT.prepareDataForTableModel switched from
      per-row execute() to addBatch()/executeBatch() in chunks of 500.
---
 .github/workflows/cluster-it-ainode-cpu.yml        | 70 ++++++++++++++++
 integration-test/pom.xml                           | 14 ++++
 .../iotdb/it/env/cluster/node/AINodeWrapper.java   | 83 ++++++++++++-------
 .../org/apache/iotdb/itbase/category/AINodeIT.java | 27 ++++++
 ...NodeClusterConfigIT.java => AINodeBasicIT.java} | 95 ++++++++++------------
 .../iotdb/ainode/it/AINodeClusterConfigIT.java     |  4 +-
 .../ainode/it/AINodeConcurrentForecastIT.java      | 11 ++-
 .../iotdb/ainode/it/AINodeSharedClusterIT.java     | 54 ------------
 .../apache/iotdb/ainode/utils/AINodeTestUtils.java | 21 ++++-
 9 files changed, 236 insertions(+), 143 deletions(-)

diff --git a/.github/workflows/cluster-it-ainode-cpu.yml 
b/.github/workflows/cluster-it-ainode-cpu.yml
new file mode 100644
index 00000000000..6046a13ba04
--- /dev/null
+++ b/.github/workflows/cluster-it-ainode-cpu.yml
@@ -0,0 +1,70 @@
+name: AINode IT - CPU
+
+on:
+  push:
+    branches:
+      - master
+      - 'rel/*'
+      - 'rc/*'
+    paths-ignore:
+      - 'docs/**'
+      - 'site/**'
+  pull_request:
+    branches:
+      - master
+      - 'rel/*'
+      - 'rc/*'
+      - 'force_ci/**'
+    paths-ignore:
+      - 'docs/**'
+      - 'site/**'
+  workflow_dispatch:
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref }}
+  cancel-in-progress: true
+
+env:
+  MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false 
-Dmaven.wagon.http.retryHandler.class=standard 
-Dmaven.wagon.http.retryHandler.count=3
+  MAVEN_ARGS: --batch-mode --no-transfer-progress
+  DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
+
+jobs:
+  AINode-CPU:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v5
+      - name: Set up JDK
+        uses: actions/setup-java@v5
+        with:
+          distribution: corretto
+          java-version: 17
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+      - name: Cache Maven packages
+        uses: actions/cache@v5
+        with:
+          path: ~/.m2
+          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-m2-
+      - name: Adjust Linux kernel somaxconn
+        shell: bash
+        run: sudo sysctl -w net.core.somaxconn=65535
+      - name: IT Test
+        shell: bash
+        run: |
+          mvn clean verify \
+          -P with-integration-tests,with-ainode \
+          -DskipUTs \
+          -DintegrationTest.forkCount=1 \
+          -pl integration-test,iotdb-core/ainode \
+          -am \
+          -PAINodeIT
+      - name: Upload Artifact
+        if: failure()
+        uses: actions/upload-artifact@v6
+        with:
+          name: ainode-cpu-logs
+          path: integration-test/target/*-logs
+          retention-days: 30
diff --git a/integration-test/pom.xml b/integration-test/pom.xml
index c61509ed2c8..dc60f3e62a9 100644
--- a/integration-test/pom.xml
+++ b/integration-test/pom.xml
@@ -693,6 +693,20 @@
                 <integrationTest.testEnv>AI</integrationTest.testEnv>
             </properties>
         </profile>
+        <profile>
+            <id>AINodeIT</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <properties>
+                
<integrationTest.excludedGroups>org.apache.iotdb.itbase.category.ManualIT</integrationTest.excludedGroups>
+                
<integrationTest.includedGroups>org.apache.iotdb.itbase.category.AINodeIT</integrationTest.includedGroups>
+                
<integrationTest.launchNodeInSameJVM>false</integrationTest.launchNodeInSameJVM>
+                
<integrationTest.randomSelectWriteNode>false</integrationTest.randomSelectWriteNode>
+                
<integrationTest.readAndVerifyWithMultiNode>false</integrationTest.readAndVerifyWithMultiNode>
+                <integrationTest.testEnv>AI</integrationTest.testEnv>
+            </properties>
+        </profile>
         <profile>
             <id>DailyIT</id>
             <activation>
diff --git 
a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AINodeWrapper.java
 
b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AINodeWrapper.java
index d452e19f381..d21caebf10a 100644
--- 
a/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AINodeWrapper.java
+++ 
b/integration-test/src/main/java/org/apache/iotdb/it/env/cluster/node/AINodeWrapper.java
@@ -131,37 +131,62 @@ public class AINodeWrapper extends AbstractNodeWrapper {
           },
           propertiesFile);
 
-      // copy built-in LTSM
+      // Link built-in LTSM weights from the runner-wide cache. These can be 
hundreds of MB to
+      // multiple GB; copying them per fork dominates IT startup. Symlinks 
share read-only weights
+      // across forks; we fall back to a copy on platforms / filesystems that 
reject symlinks.
+      // CPU-only runners that only run metadata-level AINode tests won't have 
the cache pre-staged
+      // — log and skip in that case rather than failing.
       String builtInModelPath = filePrefix + File.separator + 
BUILT_IN_MODEL_PATH;
-      new File(builtInModelPath).mkdirs();
-      try {
-        if (new File(builtInModelPath).exists()) {
-          PathUtils.deleteDirectory(Paths.get(builtInModelPath));
+      File builtInModelDir = new File(builtInModelPath);
+      Path cacheRoot = Paths.get(CACHE_BUILT_IN_MODEL_PATH);
+      if (!Files.isDirectory(cacheRoot)) {
+        logger.info(
+            "AINode model weight cache {} not present; starting AINode without 
preloaded weights",
+            cacheRoot);
+        builtInModelDir.mkdirs();
+      } else {
+        try {
+          if (builtInModelDir.exists()) {
+            PathUtils.deleteDirectory(builtInModelDir.toPath());
+          }
+        } catch (NoSuchFileException e) {
+          // ignored
+        }
+        Path destRoot = builtInModelDir.toPath();
+        builtInModelDir.getParentFile().mkdirs();
+        try {
+          Files.createSymbolicLink(destRoot, cacheRoot);
+          logger.info("AINode symlinked model weights {} -> {}", destRoot, 
cacheRoot);
+        } catch (UnsupportedOperationException | IOException symlinkErr) {
+          logger.warn(
+              "AINode failed to symlink {} -> {} ({}), falling back to copy",
+              destRoot,
+              cacheRoot,
+              symlinkErr.toString());
+          builtInModelDir.mkdirs();
+          try (Stream<Path> s = Files.walk(cacheRoot)) {
+            s.forEach(
+                source -> {
+                  Path destination =
+                      Paths.get(
+                          builtInModelPath,
+                          
source.toString().substring(CACHE_BUILT_IN_MODEL_PATH.length()));
+                  logger.info("AINode copying model weights from {} to {}", 
source, destination);
+                  try {
+                    Files.copy(
+                        source,
+                        destination,
+                        LinkOption.NOFOLLOW_LINKS,
+                        StandardCopyOption.COPY_ATTRIBUTES);
+                  } catch (IOException e) {
+                    logger.error("AINode got error copying model weights", e);
+                    throw new RuntimeException(e);
+                  }
+                });
+          } catch (Exception e) {
+            logger.error("AINode got error copying model weights", e);
+          }
         }
-      } catch (NoSuchFileException e) {
-        // ignored
-      }
-      try (Stream<Path> s = Files.walk(Paths.get(CACHE_BUILT_IN_MODEL_PATH))) {
-        s.forEach(
-            source -> {
-              Path destination =
-                  Paths.get(
-                      builtInModelPath,
-                      
source.toString().substring(CACHE_BUILT_IN_MODEL_PATH.length()));
-              logger.info("AINode copying model weights from {} to {}", 
source, destination);
-              try {
-                Files.copy(
-                    source,
-                    destination,
-                    LinkOption.NOFOLLOW_LINKS,
-                    StandardCopyOption.COPY_ATTRIBUTES);
-              } catch (IOException e) {
-                logger.error("AINode got error copying model weights", e);
-                throw new RuntimeException(e);
-              }
-            });
-      } catch (Exception e) {
-        logger.error("AINode got error copying model weights", e);
       }
 
       // start AINode
diff --git 
a/integration-test/src/main/java/org/apache/iotdb/itbase/category/AINodeIT.java 
b/integration-test/src/main/java/org/apache/iotdb/itbase/category/AINodeIT.java
new file mode 100644
index 00000000000..328ecbb0a83
--- /dev/null
+++ 
b/integration-test/src/main/java/org/apache/iotdb/itbase/category/AINodeIT.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.iotdb.itbase.category;
+
+/**
+ * Marker for AINode integration tests that exercise only metadata / lifecycle 
paths and therefore
+ * don't need a GPU. Tests tagged with this category can run on plain CPU 
runners; tests that drive
+ * inference, forecasting, or device-binding still belong in {@link 
AIClusterIT}.
+ */
+public interface AINodeIT {}
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeClusterConfigIT.java
 b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java
similarity index 55%
copy from 
integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeClusterConfigIT.java
copy to 
integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java
index de6d3c48be3..04832ae120e 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeClusterConfigIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeBasicIT.java
@@ -19,13 +19,13 @@
 
 package org.apache.iotdb.ainode.it;
 
+import org.apache.iotdb.ainode.utils.AINodeTestUtils.FakeModelInfo;
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
-import org.apache.iotdb.itbase.category.AIClusterIT;
+import org.apache.iotdb.itbase.category.AINodeIT;
 import org.apache.iotdb.itbase.env.BaseEnv;
 
 import org.junit.AfterClass;
-import org.junit.Assert;
 import org.junit.BeforeClass;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
@@ -33,15 +33,23 @@ import org.junit.runner.RunWith;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.sql.Statement;
 
+import static org.apache.iotdb.ainode.utils.AINodeTestUtils.BUILTIN_MODEL_MAP;
 import static org.apache.iotdb.ainode.utils.AINodeTestUtils.checkHeader;
+import static org.apache.iotdb.ainode.utils.AINodeTestUtils.errorTest;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 
+/**
+ * Metadata-only AINode tests that don't drive inference or bind GPU devices, 
so they can run on a
+ * plain CPU runner. Tests that do exercise CUDA paths live in {@link 
AINodeSharedClusterIT}.
+ */
 @RunWith(IoTDBTestRunner.class)
-@Category({AIClusterIT.class})
-public class AINodeClusterConfigIT {
+@Category({AINodeIT.class})
+public class AINodeBasicIT {
 
   @BeforeClass
   public static void setUp() throws Exception {
@@ -54,74 +62,55 @@ public class AINodeClusterConfigIT {
   }
 
   @Test
-  public void aiNodeRegisterAndRemoveTest() throws SQLException {
-    String show_sql = "SHOW AINODES";
-    String title = "NodeID,Status,InternalAddress,InternalPort";
-
-    // Verify AINode exists via both dialects before removal
+  public void dropBuiltInModelErrorTestInTree() throws SQLException {
     try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
-      verifyAINodeExists(statement, show_sql, title);
+      errorTest(statement, "drop model sundial", "1506: Cannot delete built-in 
model: sundial");
     }
+  }
+
+  @Test
+  public void dropBuiltInModelErrorTestInTable() throws SQLException {
     try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
-      verifyAINodeExists(statement, show_sql, title);
+      errorTest(statement, "drop model sundial", "1506: Cannot delete built-in 
model: sundial");
     }
+  }
 
-    // Remove AINode
+  @Test
+  public void showBuiltInModelTestInTree() throws SQLException {
     try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
-      statement.execute("REMOVE AINODE");
-      waitForAINodeRemoval(statement, show_sql, title);
+      showBuiltInModelTest(statement);
     }
+  }
 
-    // Verify removal is visible via table dialect as well
+  @Test
+  public void showBuiltInModelTestInTable() throws SQLException {
     try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
-      try (ResultSet resultSet = statement.executeQuery(show_sql)) {
-        checkHeader(resultSet.getMetaData(), title);
-        int count = 0;
-        while (resultSet.next()) {
-          count++;
-        }
-        assertEquals(0, count);
-      }
+      showBuiltInModelTest(statement);
     }
   }
 
-  private static void verifyAINodeExists(Statement statement, String showSql, 
String title)
-      throws SQLException {
+  private void showBuiltInModelTest(Statement statement) throws SQLException {
+    int builtInModelCount = 0;
+    final String showSql = "SHOW MODELS";
     try (ResultSet resultSet = statement.executeQuery(showSql)) {
-      checkHeader(resultSet.getMetaData(), title);
-      int count = 0;
+      ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
+      checkHeader(resultSetMetaData, "ModelId,ModelType,Category,State");
       while (resultSet.next()) {
-        assertEquals("2", resultSet.getString(1));
-        assertEquals("Running", resultSet.getString(2));
-        count++;
-      }
-      assertEquals(1, count);
-    }
-  }
-
-  private static void waitForAINodeRemoval(Statement statement, String 
showSql, String title)
-      throws SQLException {
-    for (int retry = 0; retry < 500; retry++) {
-      try (ResultSet resultSet = statement.executeQuery(showSql)) {
-        checkHeader(resultSet.getMetaData(), title);
-        int count = 0;
-        while (resultSet.next()) {
-          count++;
-        }
-        if (count == 0) {
-          return;
-        }
-      }
-      try {
-        Thread.sleep(1000);
-      } catch (InterruptedException e) {
-        Thread.currentThread().interrupt();
+        builtInModelCount++;
+        FakeModelInfo modelInfo =
+            new FakeModelInfo(
+                resultSet.getString(1),
+                resultSet.getString(2),
+                resultSet.getString(3),
+                resultSet.getString(4));
+        assertTrue(BUILTIN_MODEL_MAP.containsKey(modelInfo.getModelId()));
+        assertEquals(BUILTIN_MODEL_MAP.get(modelInfo.getModelId()), modelInfo);
       }
     }
-    Assert.fail("The target AINode is not removed successfully after all 
retries.");
+    assertEquals(BUILTIN_MODEL_MAP.size(), builtInModelCount);
   }
 }
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeClusterConfigIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeClusterConfigIT.java
index de6d3c48be3..5c4d8fafd1a 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeClusterConfigIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeClusterConfigIT.java
@@ -21,7 +21,7 @@ package org.apache.iotdb.ainode.it;
 
 import org.apache.iotdb.it.env.EnvFactory;
 import org.apache.iotdb.it.framework.IoTDBTestRunner;
-import org.apache.iotdb.itbase.category.AIClusterIT;
+import org.apache.iotdb.itbase.category.AINodeIT;
 import org.apache.iotdb.itbase.env.BaseEnv;
 
 import org.junit.AfterClass;
@@ -40,7 +40,7 @@ import static 
org.apache.iotdb.ainode.utils.AINodeTestUtils.checkHeader;
 import static org.junit.Assert.assertEquals;
 
 @RunWith(IoTDBTestRunner.class)
-@Category({AIClusterIT.class})
+@Category({AINodeIT.class})
 public class AINodeClusterConfigIT {
 
   @BeforeClass
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentForecastIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentForecastIT.java
index fd021099d5f..3e1c616580e 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentForecastIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeConcurrentForecastIT.java
@@ -75,10 +75,15 @@ public class AINodeConcurrentForecastIT {
       statement.execute("CREATE DATABASE root");
       statement.execute("CREATE TABLE root.AI (s DOUBLE FIELD)");
       for (int i = 0; i < 2880; i++) {
-        statement.execute(
+        statement.addBatch(
             String.format(
                 "INSERT INTO root.AI(time, s) VALUES(%d, %f)", i, Math.sin(i * 
Math.PI / 1440)));
+        if ((i + 1) % 500 == 0) {
+          statement.executeBatch();
+          statement.clearBatch();
+        }
       }
+      statement.executeBatch();
     }
   }
 
@@ -101,7 +106,9 @@ public class AINodeConcurrentForecastIT {
           String.format(
               FORECAST_TABLE_FUNCTION_SQL_TEMPLATE, modelInfo.getModelId(), 
forecastLength);
       final int threadCnt = 10;
-      final int loop = 100;
+      // PR CI keeps a concurrency smoke check; nightly/daily can dial this up 
if regressions
+      // appear.
+      final int loop = 10;
       statement.execute(
           String.format("LOAD MODEL %s TO DEVICES '%s'", 
modelInfo.getModelId(), devices));
       checkModelOnSpecifiedDevice(statement, modelInfo.getModelId(), devices);
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeSharedClusterIT.java
 
b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeSharedClusterIT.java
index 7a71682f167..87930a1bfec 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeSharedClusterIT.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/ainode/it/AINodeSharedClusterIT.java
@@ -54,7 +54,6 @@ import static 
org.apache.iotdb.ainode.utils.AINodeTestUtils.prepareDataInTable;
 import static org.apache.iotdb.ainode.utils.AINodeTestUtils.prepareDataInTree;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 /**
@@ -168,59 +167,6 @@ public class AINodeSharedClusterIT {
     }
   }
 
-  @Test
-  public void dropBuiltInModelErrorTestInTree() throws SQLException {
-    try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT);
-        Statement statement = connection.createStatement()) {
-      errorTest(statement, "drop model sundial", "1506: Cannot delete built-in 
model: sundial");
-    }
-  }
-
-  @Test
-  public void dropBuiltInModelErrorTestInTable() throws SQLException {
-    try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
-        Statement statement = connection.createStatement()) {
-      errorTest(statement, "drop model sundial", "1506: Cannot delete built-in 
model: sundial");
-    }
-  }
-
-  @Test
-  public void showBuiltInModelTestInTree() throws SQLException {
-    try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT);
-        Statement statement = connection.createStatement()) {
-      showBuiltInModelTest(statement);
-    }
-  }
-
-  @Test
-  public void showBuiltInModelTestInTable() throws SQLException {
-    try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TABLE_SQL_DIALECT);
-        Statement statement = connection.createStatement()) {
-      showBuiltInModelTest(statement);
-    }
-  }
-
-  private void showBuiltInModelTest(Statement statement) throws SQLException {
-    int built_in_model_count = 0;
-    final String showSql = "SHOW MODELS";
-    try (ResultSet resultSet = statement.executeQuery(showSql)) {
-      ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
-      checkHeader(resultSetMetaData, "ModelId,ModelType,Category,State");
-      while (resultSet.next()) {
-        built_in_model_count++;
-        FakeModelInfo modelInfo =
-            new FakeModelInfo(
-                resultSet.getString(1),
-                resultSet.getString(2),
-                resultSet.getString(3),
-                resultSet.getString(4));
-        assertTrue(BUILTIN_MODEL_MAP.containsKey(modelInfo.getModelId()));
-        assertEquals(BUILTIN_MODEL_MAP.get(modelInfo.getModelId()), modelInfo);
-      }
-    }
-    assertEquals(BUILTIN_MODEL_MAP.size(), built_in_model_count);
-  }
-
   // ========== CallInference tests ==========
 
   @Test
diff --git 
a/integration-test/src/test/java/org/apache/iotdb/ainode/utils/AINodeTestUtils.java
 
b/integration-test/src/test/java/org/apache/iotdb/ainode/utils/AINodeTestUtils.java
index d69a301c066..8f5567c7c9c 100644
--- 
a/integration-test/src/test/java/org/apache/iotdb/ainode/utils/AINodeTestUtils.java
+++ 
b/integration-test/src/test/java/org/apache/iotdb/ainode/utils/AINodeTestUtils.java
@@ -232,11 +232,16 @@ public class AINodeTestUtils {
     try (Connection connection = 
EnvFactory.getEnv().getConnection(BaseEnv.TREE_SQL_DIALECT);
         Statement statement = connection.createStatement()) {
       for (int i = 0; i < 5760; i++) {
-        statement.execute(
+        statement.addBatch(
             String.format(
                 "INSERT INTO root.AI(timestamp,s0,s1,s2,s3) 
VALUES(%d,%f,%f,%d,%d)",
                 i, (float) i, (double) i, i, i));
+        if ((i + 1) % 500 == 0) {
+          statement.executeBatch();
+          statement.clearBatch();
+        }
       }
+      statement.executeBatch();
     }
   }
 
@@ -248,11 +253,16 @@ public class AINodeTestUtils {
       statement.execute(
           "CREATE TABLE db.AI (s0 FLOAT FIELD, s1 DOUBLE FIELD, s2 INT32 
FIELD, s3 INT64 FIELD)");
       for (int i = 0; i < 5760; i++) {
-        statement.execute(
+        statement.addBatch(
             String.format(
                 "INSERT INTO db.AI(time,s0,s1,s2,s3) VALUES(%d,%f,%f,%d,%d)",
                 i, (float) i, (double) i, i, i));
+        if ((i + 1) % 500 == 0) {
+          statement.executeBatch();
+          statement.clearBatch();
+        }
       }
+      statement.executeBatch();
     }
   }
 
@@ -264,7 +274,7 @@ public class AINodeTestUtils {
       statement.execute(
           "CREATE TABLE db.AI2 (s0 FLOAT FIELD, s1 DOUBLE FIELD, s2 INT32 
FIELD, s3 INT64 FIELD, s4 FLOAT FIELD, s5 DOUBLE FIELD, s6 INT32 FIELD, s7 
INT64 FIELD, s8 FLOAT FIELD, s9 DOUBLE FIELD)");
       for (int i = 0; i < 2880; i++) {
-        statement.execute(
+        statement.addBatch(
             String.format(
                 "INSERT INTO db.AI2(time,s0,s1,s2,s3,s4,s5,s6,s7,s8,s9) 
VALUES(%d,%f,%f,%d,%d,%f,%f,%d,%d,%f,%f)",
                 i,
@@ -278,7 +288,12 @@ public class AINodeTestUtils {
                 i * 2,
                 (float) (i * 3),
                 (double) (i * 3)));
+        if ((i + 1) % 500 == 0) {
+          statement.executeBatch();
+          statement.clearBatch();
+        }
       }
+      statement.executeBatch();
     }
   }
 

Reply via email to