diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f68ae511119d..f0b6f47da5f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ on: default: '' required: false env: - BUILD_ARGS: "-Pdist -Psrc -Dmaven.javadoc.skip=true" + BUILD_ARGS: "-Pdist -Psrc -Dmaven.javadoc.skip=true -Drocks_tools_native" # Minimum required Java version for running Ozone is defined in pom.xml (javac.version). TEST_JAVA_VERSION: 21 # JDK version used by CI build and tests; should match the JDK version in apache/ozone-runner image # MAVEN_ARGS and MAVEN_OPTS are duplicated in check.yml, please keep in sync @@ -44,7 +44,6 @@ jobs: acceptance-suites: ${{ steps.acceptance-suites.outputs.suites }} integration-suites: ${{ steps.integration-suites.outputs.suites }} needs-basic-check: ${{ steps.categorize-basic-checks.outputs.needs-basic-check }} - needs-native-check: ${{ steps.categorize-basic-checks.outputs.needs-native-check }} basic-checks: ${{ steps.categorize-basic-checks.outputs.basic-checks }} needs-build: ${{ steps.selective-checks.outputs.needs-build }} needs-compile: ${{ steps.selective-checks.outputs.needs-compile }} @@ -174,21 +173,6 @@ jobs: check: ${{ fromJson(needs.build-info.outputs.basic-checks) }} fail-fast: false - native: - needs: - - build-info - - basic - if: needs.build-info.outputs.needs-native-check == 'true' - uses: ./.github/workflows/check.yml - secrets: inherit - with: - java-version: ${{ needs.build-info.outputs.java-version }} - ratis-args: ${{ inputs.ratis_args }} - script: native - sha: ${{ needs.build-info.outputs.sha }} - timeout-minutes: 150 - with-coverage: ${{ fromJSON(needs.build-info.outputs.with-coverage) }} - dependency: needs: - build-info @@ -289,7 +273,7 @@ jobs: java-version: ${{ needs.build-info.outputs.java-version }} ratis-args: ${{ inputs.ratis_args }} script: integration - script-args: -Ptest-${{ matrix.profile }} + script-args: -Ptest-${{ matrix.profile }} -Drocks_tools_native sha: ${{ needs.build-info.outputs.sha }} split: ${{ matrix.profile }} timeout-minutes: 150 @@ -307,7 +291,6 @@ jobs: - build-info - acceptance - integration - - native steps: - name: Checkout project uses: actions/checkout@v4 diff --git a/dev-support/ci/categorize_basic_checks.sh b/dev-support/ci/categorize_basic_checks.sh index 9b4adf264089..23dc38dfbe2d 100755 --- a/dev-support/ci/categorize_basic_checks.sh +++ b/dev-support/ci/categorize_basic_checks.sh @@ -30,7 +30,7 @@ if [[ -n "${SPACE_DELIMITED_ALL_CHECKS}" ]]; then # add framing blanks SPACE_DELIMITED_ALL_CHECKS=" ${SPACE_DELIMITED_ALL_CHECKS[*]} " - for check in basic native; do + for check in basic; do CHECKS=$(grep -lr "^#checks:${check}$" hadoop-ozone/dev-support/checks \ | sort -u \ | xargs -n1 basename \ diff --git a/dev-support/ci/selective_ci_checks.bats b/dev-support/ci/selective_ci_checks.bats index e1d5ee7578b5..12600c065ff3 100644 --- a/dev-support/ci/selective_ci_checks.bats +++ b/dev-support/ci/selective_ci_checks.bats @@ -135,7 +135,7 @@ load bats-assert/load.bash @test "script change including junit.sh" { run dev-support/ci/selective_ci_checks.sh 66093e52c6 - assert_output -p 'basic-checks=["rat","bats","checkstyle","findbugs","native"]' + assert_output -p 'basic-checks=["rat","bats","checkstyle","findbugs"]' assert_output -p needs-build=true assert_output -p needs-compile=true assert_output -p needs-compose-tests=false @@ -179,22 +179,22 @@ load bats-assert/load.bash @test "native only" { run dev-support/ci/selective_ci_checks.sh 5b1319a8c2 - assert_output -p 'basic-checks=["rat","author","checkstyle","findbugs","pmd","native"]' + assert_output -p 'basic-checks=["rat","author","checkstyle","findbugs","pmd"]' assert_output -p needs-build=true assert_output -p needs-compile=true - assert_output -p needs-compose-tests=false - assert_output -p needs-integration-tests=false - assert_output -p needs-kubernetes-tests=false + assert_output -p needs-compose-tests=true + assert_output -p needs-integration-tests=true + assert_output -p needs-kubernetes-tests=true } @test "native test in other module" { run dev-support/ci/selective_ci_checks.sh 822c0dee1a - assert_output -p 'basic-checks=["rat","author","checkstyle","findbugs","pmd","native"]' + assert_output -p 'basic-checks=["rat","author","checkstyle","findbugs","pmd"]' assert_output -p needs-build=true assert_output -p needs-compile=true assert_output -p needs-compose-tests=false - assert_output -p needs-integration-tests=false + assert_output -p needs-integration-tests=true assert_output -p needs-kubernetes-tests=false } @@ -245,7 +245,7 @@ load bats-assert/load.bash @test "java and compose change" { run dev-support/ci/selective_ci_checks.sh d0f0f806e - assert_output -p 'basic-checks=["rat","author","checkstyle","findbugs","pmd","native"]' + assert_output -p 'basic-checks=["rat","author","checkstyle","findbugs","pmd"]' assert_output -p needs-build=true assert_output -p needs-compile=true assert_output -p needs-compose-tests=true @@ -267,7 +267,7 @@ load bats-assert/load.bash @test "pom change" { run dev-support/ci/selective_ci_checks.sh 9129424a9 - assert_output -p 'basic-checks=["rat","checkstyle","findbugs","pmd","native"]' + assert_output -p 'basic-checks=["rat","checkstyle","findbugs","pmd"]' assert_output -p needs-build=true assert_output -p needs-compile=true assert_output -p needs-compose-tests=true @@ -278,7 +278,7 @@ load bats-assert/load.bash @test "CI lib change" { run dev-support/ci/selective_ci_checks.sh ceb79acaa - assert_output -p 'basic-checks=["author","bats","checkstyle","docs","findbugs","native","pmd","rat"]' + assert_output -p 'basic-checks=["author","bats","checkstyle","docs","findbugs","pmd","rat"]' assert_output -p needs-build=true assert_output -p needs-compile=true assert_output -p needs-compose-tests=true @@ -289,7 +289,7 @@ load bats-assert/load.bash @test "CI workflow change" { run dev-support/ci/selective_ci_checks.sh 90a8d7c01 - assert_output -p 'basic-checks=["author","bats","checkstyle","docs","findbugs","native","pmd","rat"]' + assert_output -p 'basic-checks=["author","bats","checkstyle","docs","findbugs","pmd","rat"]' assert_output -p needs-build=true assert_output -p needs-compile=true assert_output -p needs-compose-tests=true @@ -312,7 +312,7 @@ load bats-assert/load.bash @test "CI workflow change (ci.yaml)" { run dev-support/ci/selective_ci_checks.sh 90fd5f2adc - assert_output -p 'basic-checks=["author","bats","checkstyle","docs","findbugs","native","pmd","rat"]' + assert_output -p 'basic-checks=["author","bats","checkstyle","docs","findbugs","pmd","rat"]' assert_output -p needs-build=true assert_output -p needs-compile=true assert_output -p needs-compose-tests=true @@ -411,7 +411,7 @@ load bats-assert/load.bash @test "properties file in resources" { run dev-support/ci/selective_ci_checks.sh 71b8bdd8becf72d6f7d4e7986895504b8259b3e5 - assert_output -p 'basic-checks=["rat","checkstyle","native"]' + assert_output -p 'basic-checks=["rat","checkstyle"]' assert_output -p needs-build=false assert_output -p needs-compile=false assert_output -p needs-compose-tests=false diff --git a/dev-support/ci/selective_ci_checks.sh b/dev-support/ci/selective_ci_checks.sh index f46d8fb49861..10c6044e3146 100755 --- a/dev-support/ci/selective_ci_checks.sh +++ b/dev-support/ci/selective_ci_checks.sh @@ -266,9 +266,6 @@ function get_count_integration_files() { "src/test/java" "src/test/resources" ) - local ignore_array=( - $(grep -Flr 'org.apache.ozone.test.tag.Native' hadoop-ozone/integration-test) - ) filter_changed_files true COUNT_INTEGRATION_CHANGED_FILES=${match_count} readonly COUNT_INTEGRATION_CHANGED_FILES @@ -440,40 +437,6 @@ function check_needs_pmd() { start_end::group_end } -function check_needs_native() { - start_end::group_start "Check if native is needed" - local pattern_array=( - "^hadoop-ozone/dev-support/checks/native.sh" - "^hadoop-hdds/rocks-native" - # include tests tagged as @Native in any module - $(grep -Flr 'org.apache.ozone.test.tag.Native' hadoop-*/*/src/test/java) - ) - filter_changed_files true - - if [[ ${match_count} != "0" ]]; then - add_basic_check native - else - local pattern_array=( - "^hadoop-ozone/dev-support/checks/junit.sh" - # dependencies - "^hadoop-hdds/annotations" - "^hadoop-hdds/common" - "^hadoop-hdds/config" - "^hadoop-hdds/hadoop-dependency-client" - "^hadoop-hdds/managed-rocksdb" - "^hadoop-hdds/test-utils" - "^pom.xml" - ) - filter_changed_files - - if [[ ${match_count} != "0" ]]; then - add_basic_check native - fi - fi - - start_end::group_end -} - # Counts other files which do not need to trigger any functional test # (i.e. no compose/integration/kubernetes) function get_count_misc_files() { @@ -609,6 +572,5 @@ check_needs_checkstyle check_needs_docs check_needs_findbugs check_needs_pmd -check_needs_native calculate_test_types_to_run set_outputs diff --git a/hadoop-hdds/rocks-native/pom.xml b/hadoop-hdds/rocks-native/pom.xml index 8f0da5a368f9..5c3eeb86899b 100644 --- a/hadoop-hdds/rocks-native/pom.xml +++ b/hadoop-hdds/rocks-native/pom.xml @@ -336,7 +336,6 @@ org.apache.maven.plugins maven-surefire-plugin - native ${maven-surefire-plugin.argLine} @{argLine} -Djava.library.path=${project.build.directory}/native/rocksdb diff --git a/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeConstants.java b/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeConstants.java index eb89264af4b4..7d49eb20d768 100644 --- a/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeConstants.java +++ b/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/NativeConstants.java @@ -26,4 +26,5 @@ private NativeConstants() { } public static final String ROCKS_TOOLS_NATIVE_LIBRARY_NAME = "ozone_rocksdb_tools"; + public static final String ROCKS_TOOLS_NATIVE_PROPERTY = "rocks_tools_native"; } diff --git a/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedRawSSTFileReader.java b/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedRawSSTFileReader.java index b441784c4dbf..eadf1afcb879 100644 --- a/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedRawSSTFileReader.java +++ b/hadoop-hdds/rocks-native/src/main/java/org/apache/hadoop/hdds/utils/db/managed/ManagedRawSSTFileReader.java @@ -32,6 +32,15 @@ */ public class ManagedRawSSTFileReader implements Closeable { + public static boolean tryLoadLibrary() { + try { + loadLibrary(); + return true; + } catch (NativeLibraryNotLoadedException ignored) { + return false; + } + } + public static boolean loadLibrary() throws NativeLibraryNotLoadedException { ManagedRocksObjectUtils.loadRocksDBLibrary(); if (!NativeLibraryLoader.getInstance().loadLibrary(ROCKS_TOOLS_NATIVE_LIBRARY_NAME, Arrays.asList( diff --git a/hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/TestNativeLibraryLoader.java b/hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/TestNativeLibraryLoader.java index 4f0b0ae9c787..3dbbdc35513a 100644 --- a/hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/TestNativeLibraryLoader.java +++ b/hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/TestNativeLibraryLoader.java @@ -18,6 +18,7 @@ package org.apache.hadoop.hdds.utils; import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_LIBRARY_NAME; +import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY; import static org.apache.hadoop.hdds.utils.NativeLibraryLoader.NATIVE_LIB_TMP_DIR; import static org.apache.hadoop.hdds.utils.NativeLibraryLoader.getJniLibraryFileName; import static org.assertj.core.api.Assertions.assertThat; @@ -37,7 +38,7 @@ import java.util.stream.Stream; import org.apache.commons.io.FileUtils; import org.apache.hadoop.hdds.utils.db.managed.ManagedRawSSTFileReader; -import org.apache.ozone.test.tag.Native; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.MethodSource; @@ -55,7 +56,7 @@ private static Stream nativeLibraryDirectoryLocations() { return Stream.of("", tempDir.toAbsolutePath().toString(), null); } - @Native(ROCKS_TOOLS_NATIVE_LIBRARY_NAME) + @EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") @ParameterizedTest @MethodSource("nativeLibraryDirectoryLocations") public void testNativeLibraryLoader(String nativeLibraryDirectoryLocation) throws NativeLibraryNotLoadedException { diff --git a/hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestManagedRawSSTFileIterator.java b/hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestManagedRawSSTFileIterator.java index 6c7a5a3b8b75..98f8708e211a 100644 --- a/hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestManagedRawSSTFileIterator.java +++ b/hadoop-hdds/rocks-native/src/test/java/org/apache/hadoop/hdds/utils/db/managed/TestManagedRawSSTFileIterator.java @@ -17,7 +17,7 @@ package org.apache.hadoop.hdds.utils.db.managed; -import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_LIBRARY_NAME; +import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY; import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -37,9 +37,9 @@ import org.apache.hadoop.hdds.StringUtils; import org.apache.hadoop.hdds.utils.NativeLibraryNotLoadedException; import org.apache.hadoop.hdds.utils.TestUtils; -import org.apache.ozone.test.tag.Native; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Named; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -48,7 +48,7 @@ /** * Test for ManagedRawSSTFileReaderIterator. */ -@Native(ROCKS_TOOLS_NATIVE_LIBRARY_NAME) +@EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") class TestManagedRawSSTFileIterator { @TempDir @@ -74,7 +74,7 @@ private File createSSTFileWithKeys( return file; } - private static Stream keyValueFormatArgs() { + private static Stream keyValueFormatArgs() { return Stream.of(Arguments.of(Named.of("Key starting with a single quote", "'key%1$d=>"), Named.of("Value starting with a number ending with a single quote", "%1$dvalue'")), Arguments.of(Named.of("Key ending with a number", "key%1$d"), diff --git a/hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdb/util/TestSstFileSetReader.java b/hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdb/util/TestSstFileSetReader.java index 7172798cb11e..bb5c243aafae 100644 --- a/hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdb/util/TestSstFileSetReader.java +++ b/hadoop-hdds/rocksdb-checkpoint-differ/src/test/java/org/apache/ozone/rocksdb/util/TestSstFileSetReader.java @@ -17,7 +17,7 @@ package org.apache.ozone.rocksdb.util; -import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_LIBRARY_NAME; +import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -37,13 +37,12 @@ import java.util.stream.Stream; import org.apache.commons.lang3.tuple.Pair; import org.apache.hadoop.hdds.StringUtils; -import org.apache.hadoop.hdds.utils.NativeLibraryNotLoadedException; import org.apache.hadoop.hdds.utils.TestUtils; import org.apache.hadoop.hdds.utils.db.managed.ManagedEnvOptions; import org.apache.hadoop.hdds.utils.db.managed.ManagedOptions; import org.apache.hadoop.hdds.utils.db.managed.ManagedRawSSTFileReader; import org.apache.hadoop.hdds.utils.db.managed.ManagedSstFileWriter; -import org.apache.ozone.test.tag.Native; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.io.TempDir; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -153,12 +152,12 @@ public void testGetKeyStream(int numberOfFiles) } } - @Native(ROCKS_TOOLS_NATIVE_LIBRARY_NAME) + @EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") @ParameterizedTest @ValueSource(ints = {0, 1, 2, 3, 7, 10}) public void testGetKeyStreamWithTombstone(int numberOfFiles) - throws RocksDBException, IOException, NativeLibraryNotLoadedException { - assumeTrue(ManagedRawSSTFileReader.loadLibrary()); + throws RocksDBException, IOException { + assumeTrue(ManagedRawSSTFileReader.tryLoadLibrary()); Pair, List> data = createDummyData(numberOfFiles); List files = data.getRight(); diff --git a/hadoop-hdds/test-utils/src/test/java/org/apache/ozone/test/tag/Native.java b/hadoop-hdds/test-utils/src/test/java/org/apache/ozone/test/tag/Native.java deleted file mode 100644 index 0e9dd8f227f5..000000000000 --- a/hadoop-hdds/test-utils/src/test/java/org/apache/ozone/test/tag/Native.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.ozone.test.tag; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; -import org.junit.jupiter.api.Tag; - -/** - * Annotation to mark JUnit5 test classes that require native libraries. - */ -@Target({ ElementType.TYPE, ElementType.METHOD }) -@Retention(RetentionPolicy.RUNTIME) -@Tag("native") -public @interface Native { - /** - * Native Library being used. - */ - String value(); -} diff --git a/hadoop-ozone/dev-support/checks/native.sh b/hadoop-ozone/dev-support/checks/native.sh deleted file mode 100755 index f9d1c1b23a96..000000000000 --- a/hadoop-ozone/dev-support/checks/native.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash -# 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. - -#checks:native - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" -CHECK=native - -source "${DIR}/junit.sh" -Pnative-tests -Drocks_tools_native \ - "$@" diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java index d8b05683ff4d..056040e3eba0 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshot.java @@ -94,6 +94,7 @@ import org.apache.hadoop.hdds.utils.db.DBProfile; import org.apache.hadoop.hdds.utils.db.DBStore; import org.apache.hadoop.hdds.utils.db.RDBStore; +import org.apache.hadoop.hdds.utils.db.managed.ManagedRawSSTFileReader; import org.apache.hadoop.hdds.utils.db.managed.ManagedRocksObjectUtils; import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport; import org.apache.hadoop.hdfs.protocol.SnapshotDiffReport.DiffReportEntry; @@ -192,6 +193,10 @@ public TestOmSnapshot(BucketLayout newBucketLayout, this.counter = new AtomicInteger(); this.createLinkedBucket = createLinkedBucket; init(); + + if (!disableNativeDiff) { + assumeTrue(ManagedRawSSTFileReader.tryLoadLibrary()); + } } /** diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java index 0d672add7d41..d8d241190579 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLib.java @@ -17,16 +17,16 @@ package org.apache.hadoop.ozone.om.snapshot; -import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_LIBRARY_NAME; +import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY; import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; -import org.apache.ozone.test.tag.Native; import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; /** * Test OmSnapshot for FSO bucket type when native lib is enabled. */ -@Native(ROCKS_TOOLS_NATIVE_LIBRARY_NAME) +@EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") @Timeout(300) class TestOmSnapshotFsoWithNativeLib extends TestOmSnapshot { TestOmSnapshotFsoWithNativeLib() throws Exception { diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java index f7672002d85c..0b1cf3abbfd3 100644 --- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java +++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOmSnapshotFsoWithNativeLibWithLinkedBuckets.java @@ -17,16 +17,16 @@ package org.apache.hadoop.ozone.om.snapshot; -import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_LIBRARY_NAME; +import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY; import static org.apache.hadoop.ozone.om.helpers.BucketLayout.FILE_SYSTEM_OPTIMIZED; -import org.apache.ozone.test.tag.Native; import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; /** * Test OmSnapshot for FSO bucket type when native lib is enabled. */ -@Native(ROCKS_TOOLS_NATIVE_LIBRARY_NAME) +@EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") @Timeout(300) class TestOmSnapshotFsoWithNativeLibWithLinkedBuckets extends TestOmSnapshot { TestOmSnapshotFsoWithNativeLibWithLinkedBuckets() throws Exception { diff --git a/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/debug/TestCheckNative.java b/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/debug/TestCheckNative.java index eb6009a686bc..3550389e21e0 100644 --- a/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/debug/TestCheckNative.java +++ b/hadoop-ozone/tools/src/test/java/org/apache/hadoop/ozone/debug/TestCheckNative.java @@ -17,15 +17,16 @@ package org.apache.hadoop.ozone.debug; -import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_LIBRARY_NAME; +import static org.apache.hadoop.hdds.utils.NativeConstants.ROCKS_TOOLS_NATIVE_PROPERTY; import static org.assertj.core.api.Assertions.assertThat; import org.apache.hadoop.hdds.utils.IOUtils; import org.apache.ozone.test.GenericTestUtils; -import org.apache.ozone.test.tag.Native; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledIfSystemProperty; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; /** * Tests for {@link CheckNative}. @@ -39,13 +40,14 @@ void init() { out = GenericTestUtils.captureOut(); } + @DisabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") @Test void testCheckNativeNotLoaded() { executeCheckNative(); assertOutput(false); } - @Native(ROCKS_TOOLS_NATIVE_LIBRARY_NAME) + @EnabledIfSystemProperty(named = ROCKS_TOOLS_NATIVE_PROPERTY, matches = "true") @Test void testCheckNativeRocksToolsLoaded() { executeCheckNative(); diff --git a/pom.xml b/pom.xml index 166fb5e8850d..54c847998fcf 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ [3.3.0,) 2.29.2 - native | unhealthy + unhealthy 3.5.0 false 1.15.1 @@ -224,8 +224,8 @@ ${project.build.directory}/test-dir 4 - - flaky | native | slow | unhealthy + + flaky | slow | unhealthy 5.1.0 3.1.9.Final 5.4.0 @@ -2289,18 +2289,6 @@ true - - - rocks-native-tests - - - rocks_tools_native - - - - unhealthy - - test-client @@ -2498,22 +2486,6 @@ maven-surefire-plugin flaky - native | slow | unhealthy - - - - - - - - native-tests - - - - org.apache.maven.plugins - maven-surefire-plugin - - native slow | unhealthy