This is an automated email from the ASF dual-hosted git repository. haonan pushed a commit to branch fix_daily_ut_it in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit e7e563cfaffee5b4e71fc736e127e6578f948783 Author: HTHou <[email protected]> AuthorDate: Thu Aug 14 10:25:44 2025 +0800 Fix some daily UT/ITs --- .github/workflows/daily-it.yml | 2 +- .../org/apache/iotdb/db/conf/PropertiesTest.java | 37 ++++++++------- .../org/apache/iotdb/db/utils/AnnotationTest.java | 53 ++++++++++++---------- 3 files changed, 49 insertions(+), 43 deletions(-) diff --git a/.github/workflows/daily-it.yml b/.github/workflows/daily-it.yml index 8f28c54e56a..052e4f7244b 100644 --- a/.github/workflows/daily-it.yml +++ b/.github/workflows/daily-it.yml @@ -71,7 +71,7 @@ jobs: mvn clean verify \ -P with-integration-tests \ -DskipUTs \ - -DintegrationTest.forkCount=2 -DDataNodeMaxHeapSize=1024 -DintegrationTest.dataRegionPerDataNode=1\ + -DintegrationTest.forkCount=2 -DDataNodeMaxHeapSize=1024 -DintegrationTest.dataRegionPerDataNode=1 \ -pl integration-test \ -am -PTableSimpleIT - name: Upload Artifact diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/conf/PropertiesTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/conf/PropertiesTest.java index 49a380acc25..158692fd41b 100755 --- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/conf/PropertiesTest.java +++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/conf/PropertiesTest.java @@ -88,24 +88,27 @@ public class PropertiesTest { @Test public void TrimPropertiesOnly() { - JavaClasses allClasses = - new ClassFileImporter() - .withImportOption(new ImportOption.DoNotIncludeTests()) - .importPackages("org.apache.iotdb"); + try { + JavaClasses allClasses = + new ClassFileImporter() + .withImportOption(new ImportOption.DoNotIncludeTests()) + .importPackages("org.apache.iotdb"); - ArchRule rule = - noClasses() - .that() - .areAssignableTo("org.apache.iotdb.db.conf.IoTDBDescriptor") - .or() - .areAssignableTo("org.apache.iotdb.db.conf.rest.IoTDBRestServiceDescriptor") - .or() - .areAssignableTo("org.apache.iotdb.commons.conf.CommonDescriptor") - .should() - .callMethod(Properties.class, "getProperty", String.class) - .orShould() - .callMethod(Properties.class, "getProperty", String.class, String.class); + ArchRule rule = + noClasses() + .that() + .areAssignableTo("org.apache.iotdb.db.conf.IoTDBDescriptor") + .or() + .areAssignableTo("org.apache.iotdb.db.conf.rest.IoTDBRestServiceDescriptor") + .or() + .areAssignableTo("org.apache.iotdb.commons.conf.CommonDescriptor") + .should() + .callMethod(Properties.class, "getProperty", String.class) + .orShould() + .callMethod(Properties.class, "getProperty", String.class, String.class); - rule.check(allClasses); + rule.check(allClasses); + } catch (OutOfMemoryError ignore) { + } } } diff --git a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/AnnotationTest.java b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/AnnotationTest.java index 335a4959f93..91ae2097089 100644 --- a/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/AnnotationTest.java +++ b/iotdb-core/datanode/src/test/java/org/apache/iotdb/db/utils/AnnotationTest.java @@ -39,33 +39,36 @@ public class AnnotationTest { @Test public void checkTestOnly() { - JavaClasses productionClasses = - new ClassFileImporter() - .withImportOption(new DoNotIncludeTests()) - .importPackages("org.apache.iotdb"); - JavaClasses testClasses = - new ClassFileImporter() - .withImportOption(new ImportOption.OnlyIncludeTests()) - .importPackages("org.apache.iotdb"); + try { + JavaClasses productionClasses = + new ClassFileImporter() + .withImportOption(new DoNotIncludeTests()) + .importPackages("org.apache.iotdb"); + JavaClasses testClasses = + new ClassFileImporter() + .withImportOption(new ImportOption.OnlyIncludeTests()) + .importPackages("org.apache.iotdb"); - List<Class> testReflectedClasses = new ArrayList<>(); - for (JavaClass testClass : testClasses) { - testReflectedClasses.add(testClass.reflect()); - } + List<Class> testReflectedClasses = new ArrayList<>(); + for (JavaClass testClass : testClasses) { + testReflectedClasses.add(testClass.reflect()); + } - ArchRule rule = - methods() - .that() - .areAnnotatedWith(TestOnly.class) - .should() - .onlyBeCalled() - .byClassesThat() - .belongToAnyOf(testReflectedClasses.toArray(new Class[0])) - .orShould() - .onlyBeCalled() - .byMethodsThat( - CanBeAnnotated.Predicates.annotatedWith(TestOnly.class)); // see next section + ArchRule rule = + methods() + .that() + .areAnnotatedWith(TestOnly.class) + .should() + .onlyBeCalled() + .byClassesThat() + .belongToAnyOf(testReflectedClasses.toArray(new Class[0])) + .orShould() + .onlyBeCalled() + .byMethodsThat( + CanBeAnnotated.Predicates.annotatedWith(TestOnly.class)); // see next section - rule.check(productionClasses); + rule.check(productionClasses); + } catch (OutOfMemoryError ignored) { + } } }
