You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ozone.apache.org by ad...@apache.org on 2022/03/16 20:21:29 UTC
[ozone] branch master updated: HDDS-6095. Skip slow integration tests, allow repeating known flaky tests 5x in CI (#3148)
This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 4454e6b HDDS-6095. Skip slow integration tests, allow repeating known flaky tests 5x in CI (#3148)
4454e6b is described below
commit 4454e6b368bc5aedaba509eeb85422daeda393bf
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Wed Mar 16 21:21:01 2022 +0100
HDDS-6095. Skip slow integration tests, allow repeating known flaky tests 5x in CI (#3148)
---
.github/workflows/post-commit.yml | 2 ++
hadoop-hdds/test-utils/pom.xml | 5 +++
.../main/java/org/apache/ozone/test/tag/Flaky.java | 40 ++++++++++++++++++++++
.../main/java/org/apache/ozone/test/tag/Slow.java | 39 +++++++++++++++++++++
.../org/apache/ozone/test/tag/package-info.java | 22 ++++++++++++
hadoop-ozone/csi/pom.xml | 4 +++
hadoop-ozone/datanode/pom.xml | 1 +
.../dev-support/checks/_mvn_unit_report.sh | 24 ++++++++-----
hadoop-ozone/dev-support/checks/integration.sh | 2 +-
.../fault-injection-test/mini-chaos-tests/pom.xml | 25 ++++++++++++++
hadoop-ozone/integration-test/pom.xml | 5 +++
.../ozone/TestDirectoryDeletingServiceWithFSO.java | 26 ++++++--------
.../hadoop/hdds/scm/TestRatisPipelineLeader.java | 19 +++++-----
.../hadoop/hdds/scm/TestSCMInstallSnapshot.java | 13 ++++---
.../TestContainerStateManagerIntegration.java | 16 ++++-----
.../hdds/scm/pipeline/TestLeaderChoosePolicy.java | 18 +++++-----
.../hdds/scm/pipeline/TestPipelineClose.java | 25 +++++---------
.../TestRatisPipelineCreateAndDestroy.java | 17 ++++-----
.../hadoop/hdds/upgrade/TestHDDSUpgrade.java | 33 ++++++++----------
.../hadoop/ozone/MiniOzoneHAClusterImpl.java | 2 +-
.../apache/hadoop/ozone/TestMiniOzoneCluster.java | 34 +++++++++---------
.../rpc/TestBlockOutputStreamWithFailures.java | 23 ++++++-------
...estBlockOutputStreamWithFailuresFlushDelay.java | 23 ++++++-------
.../TestContainerStateMachineFailureOnRead.java | 19 +++++-----
.../rpc/TestContainerStateMachineFailures.java | 13 +++----
.../client/rpc/TestFailureHandlingByClient.java | 20 ++++-------
.../ozone/client/rpc/TestOzoneRpcClient.java | 18 ++++------
.../client/rpc/TestOzoneRpcClientAbstract.java | 11 +++---
.../client/rpc/TestOzoneRpcClientWithRatis.java | 10 +++---
.../ozone/client/rpc/TestSecureOzoneRpcClient.java | 14 ++++----
.../ozone/client/rpc/TestWatchForCommit.java | 12 ++++---
.../commandhandler/TestBlockDeletion.java | 12 +++----
.../TestCloseContainerByPipeline.java | 16 +++++----
.../container/ozoneimpl/TestOzoneContainer.java | 16 ++++-----
.../container/server/TestContainerServer.java | 23 ++++++-------
.../hadoop/ozone/freon/TestRandomKeyGenerator.java | 13 +++----
.../hadoop/ozone/om/TestAddRemoveOzoneManager.java | 19 ++++------
.../apache/hadoop/ozone/om/TestOzoneManagerHA.java | 23 +++++--------
.../ozone/om/TestOzoneManagerHAKeyDeletion.java | 2 +-
.../ozone/om/TestOzoneManagerHAMetadataOnly.java | 8 ++---
.../hadoop/ozone/om/TestOzoneManagerHAWithACL.java | 2 +-
.../ozone/om/TestOzoneManagerHAWithData.java | 8 +++--
.../ozone/om/TestOzoneManagerHAWithFailover.java | 2 +-
.../hadoop/ozone/om/TestOzoneManagerPrepare.java | 14 ++++----
.../apache/hadoop/ozone/om/TestScmSafeMode.java | 2 +-
.../TestSCMContainerPlacementPolicyMetrics.java | 18 +++++-----
.../ozone/scm/TestSCMInstallSnapshotWithHA.java | 2 ++
.../scm/node/TestDecommissionAndMaintenance.java | 21 ++++++------
hadoop-ozone/interface-client/pom.xml | 4 +++
hadoop-ozone/ozonefs-hadoop2/pom.xml | 1 +
hadoop-ozone/ozonefs-hadoop3/pom.xml | 1 +
hadoop-ozone/ozonefs-shaded/pom.xml | 1 +
hadoop-ozone/recon-codegen/pom.xml | 4 +++
pom.xml | 40 +++++++++++++++++++++-
54 files changed, 481 insertions(+), 306 deletions(-)
diff --git a/.github/workflows/post-commit.yml b/.github/workflows/post-commit.yml
index caaa303..c8a36be 100644
--- a/.github/workflows/post-commit.yml
+++ b/.github/workflows/post-commit.yml
@@ -277,6 +277,7 @@ jobs:
- client
- filesystem-hdds
- ozone
+ - flaky
fail-fast: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout project
@@ -292,6 +293,7 @@ jobs:
maven-repo-
- name: Execute tests
run: hadoop-ozone/dev-support/checks/integration.sh -P${{ matrix.profile }}
+ continue-on-error: ${{ matrix.profile == 'flaky' }}
- name: Summary of failures
run: cat target/${{ github.job }}/summary.txt
if: always()
diff --git a/hadoop-hdds/test-utils/pom.xml b/hadoop-hdds/test-utils/pom.xml
index 37cb17f..1f9559b 100644
--- a/hadoop-hdds/test-utils/pom.xml
+++ b/hadoop-hdds/test-utils/pom.xml
@@ -55,6 +55,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>junit</artifactId>
</dependency>
<dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</dependency>
diff --git a/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/Flaky.java b/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/Flaky.java
new file mode 100644
index 0000000..6b86d58
--- /dev/null
+++ b/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/Flaky.java
@@ -0,0 +1,40 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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 test classes or methods with some intermittent failures.
+ * These are handled separately from the normal tests. (Not required to pass,
+ * may be repeated automatically, etc.)
+ */
+@Target({ ElementType.TYPE, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Tag("flaky")
+public @interface Flaky {
+ /**
+ * The issue tracking the flaky test.
+ */
+ String[] value();
+}
diff --git a/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/Slow.java b/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/Slow.java
new file mode 100644
index 0000000..51d312e
--- /dev/null
+++ b/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/Slow.java
@@ -0,0 +1,39 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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 test classes or methods that take too much time.
+ * These are excluded from CI runs for each commit and run periodically.
+ */
+@Target({ ElementType.TYPE, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Tag("slow")
+public @interface Slow {
+ /**
+ * Description or Jira issue.
+ */
+ String value() default "";
+}
diff --git a/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/package-info.java b/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/package-info.java
new file mode 100644
index 0000000..d5a60ec
--- /dev/null
+++ b/hadoop-hdds/test-utils/src/main/java/org/apache/ozone/test/tag/package-info.java
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+
+/**
+ * Tags are annotations for grouping tests.
+ */
+package org.apache.ozone.test;
diff --git a/hadoop-ozone/csi/pom.xml b/hadoop-ozone/csi/pom.xml
index 45645fb..67dd38f 100644
--- a/hadoop-ozone/csi/pom.xml
+++ b/hadoop-ozone/csi/pom.xml
@@ -28,6 +28,10 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
<name>Apache Ozone CSI service</name>
<packaging>jar</packaging>
+ <properties>
+ <maven.test.skip>true</maven.test.skip> <!-- no tests in this module so far -->
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
diff --git a/hadoop-ozone/datanode/pom.xml b/hadoop-ozone/datanode/pom.xml
index 748ca22..13f3087 100644
--- a/hadoop-ozone/datanode/pom.xml
+++ b/hadoop-ozone/datanode/pom.xml
@@ -27,6 +27,7 @@
<version>1.3.0-SNAPSHOT</version>
<properties>
+ <maven.test.skip>true</maven.test.skip> <!-- no tests in this module so far -->
<spotbugs.skip>true</spotbugs.skip>
</properties>
diff --git a/hadoop-ozone/dev-support/checks/_mvn_unit_report.sh b/hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
index 2d9b37c..f712377 100755
--- a/hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
+++ b/hadoop-ozone/dev-support/checks/_mvn_unit_report.sh
@@ -47,15 +47,21 @@ grep -A1 'Crashed tests' "${REPORT_DIR}/output.log" \
| sort -u \
| tee -a "${REPORT_DIR}/summary.txt"
-# Add tests where "There was a timeout or other error in the fork"
-grep -e 'Running org' -e 'Tests run: .* in org' "${REPORT_DIR}/output.log" \
- | sed -e 's/.* \(org[^ ]*\)/\1/' \
- | uniq -c \
- | grep -v ' 2 ' \
- | awk '{ print $2 }' \
- | sort -u \
- | tee -a "${REPORT_DIR}/summary.txt"
-
+# Check for tests that started but were not finished
+if grep -q 'There was a timeout or other error in the fork' "${REPORT_DIR}/output.log"; then
+ diff -uw \
+ <(grep -e 'Running org' "${REPORT_DIR}/output.log" \
+ | sed -e 's/.* \(org[^ ]*\)/\1/' \
+ | uniq -c \
+ | sort -u -k2) \
+ <(grep -e 'Tests run: .* in org' "${REPORT_DIR}/output.log" \
+ | sed -e 's/.* \(org[^ ]*\)/\1/' \
+ | uniq -c \
+ | sort -u -k2) \
+ | grep '^- ' \
+ | awk '{ print $3 }' \
+ | tee -a "${REPORT_DIR}/summary.txt"
+fi
#Collect of all of the report files of FAILED tests
for failed_test in $(< ${REPORT_DIR}/summary.txt); do
diff --git a/hadoop-ozone/dev-support/checks/integration.sh b/hadoop-ozone/dev-support/checks/integration.sh
index a8142ef..b14ecc4 100755
--- a/hadoop-ozone/dev-support/checks/integration.sh
+++ b/hadoop-ozone/dev-support/checks/integration.sh
@@ -16,4 +16,4 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
CHECK=integration
-source "${DIR}/junit.sh" -pl :ozone-integration-test,:mini-chaos-tests "$@"
+source "${DIR}/junit.sh" -pl :ozone-integration-test,:mini-chaos-tests -Dsurefire.rerunFailingTestsCount=5 -Dsurefire.fork.timeout=3600 "$@"
diff --git a/hadoop-ozone/fault-injection-test/mini-chaos-tests/pom.xml b/hadoop-ozone/fault-injection-test/mini-chaos-tests/pom.xml
index da267f4..8a2564f 100644
--- a/hadoop-ozone/fault-injection-test/mini-chaos-tests/pom.xml
+++ b/hadoop-ozone/fault-injection-test/mini-chaos-tests/pom.xml
@@ -34,6 +34,31 @@ http://maven.apache.org/xsd/maven-4.0.0.xsd">
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-migrationsupport</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.vintage</groupId>
+ <artifactId>junit-vintage-engine</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.platform</groupId>
+ <artifactId>junit-platform-launcher</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.apache.ozone</groupId>
<artifactId>hdds-test-utils</artifactId>
<scope>test</scope>
diff --git a/hadoop-ozone/integration-test/pom.xml b/hadoop-ozone/integration-test/pom.xml
index 57960d0..c3bce81 100644
--- a/hadoop-ozone/integration-test/pom.xml
+++ b/hadoop-ozone/integration-test/pom.xml
@@ -110,6 +110,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-migrationsupport</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSO.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSO.java
index 753d005..8bf3856 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSO.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestDirectoryDeletingServiceWithFSO.java
@@ -39,13 +39,13 @@ import org.apache.hadoop.ozone.om.helpers.OmDirectoryInfo;
import org.apache.hadoop.ozone.om.helpers.OmKeyInfo;
import org.apache.hadoop.ozone.om.helpers.RepeatedOmKeyInfo;
import org.apache.ozone.test.GenericTestUtils;
-import org.junit.After;
-import org.junit.AfterClass;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.AfterAll;
import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -62,17 +62,12 @@ import static org.junit.Assert.fail;
/**
* Directory deletion service test cases.
*/
+@Timeout(300)
public class TestDirectoryDeletingServiceWithFSO {
private static final Logger LOG =
LoggerFactory.getLogger(TestDirectoryDeletingServiceWithFSO.class);
- /**
- * Set a timeout for each test.
- */
- @Rule
- public Timeout timeout = Timeout.seconds(300);
-
private static boolean isBucketFSOptimized = true;
private static boolean enabledFileSystemPaths = true;
private static boolean omRatisEnabled = true;
@@ -82,7 +77,7 @@ public class TestDirectoryDeletingServiceWithFSO {
private static String volumeName;
private static String bucketName;
- @BeforeClass
+ @BeforeAll
public static void init() throws Exception {
OzoneConfiguration conf = new OzoneConfiguration();
conf.setInt(OMConfigKeys.OZONE_DIR_DELETING_SERVICE_INTERVAL, 1);
@@ -119,7 +114,7 @@ public class TestDirectoryDeletingServiceWithFSO {
fs = FileSystem.get(conf);
}
- @AfterClass
+ @AfterAll
public static void teardown() {
if (cluster != null) {
cluster.shutdown();
@@ -127,7 +122,7 @@ public class TestDirectoryDeletingServiceWithFSO {
IOUtils.closeQuietly(fs);
}
- @After
+ @AfterEach
public void cleanup() {
try {
Path root = new Path("/");
@@ -140,6 +135,7 @@ public class TestDirectoryDeletingServiceWithFSO {
}
}
+ @Flaky("HDDS-6189")
@Test
public void testDeleteEmptyDirectory() throws Exception {
Path root = new Path("/rootDir");
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestRatisPipelineLeader.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestRatisPipelineLeader.java
index 1f1e988..0cb3e65 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestRatisPipelineLeader.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestRatisPipelineLeader.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.ozone.HddsDatanodeService;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.container.common.transport.server.ratis.XceiverServerRatis;
import org.apache.ozone.test.GenericTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_RATIS_LEADER_ELECTION_MINIMUM_TIMEOUT_DURATION_KEY;
import org.apache.log4j.Level;
@@ -40,24 +41,24 @@ import org.apache.ratis.protocol.ClientId;
import org.apache.ratis.protocol.GroupInfoReply;
import org.apache.ratis.protocol.GroupInfoRequest;
import org.apache.ratis.protocol.RaftGroupId;
-import org.junit.AfterClass;
import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import org.slf4j.LoggerFactory;
/**
* Test pipeline leader information is correctly used.
*/
-@Ignore("HDDS-3265")
+@Flaky("HDDS-3265")
public class TestRatisPipelineLeader {
private static MiniOzoneCluster cluster;
private static OzoneConfiguration conf;
private static final org.slf4j.Logger LOG =
LoggerFactory.getLogger(TestRatisPipelineLeader.class);
- @BeforeClass
+ @BeforeAll
public static void setup() throws Exception {
conf = new OzoneConfiguration();
conf.set(HddsConfigKeys.HDDS_HEARTBEAT_INTERVAL, "100ms");
@@ -68,14 +69,14 @@ public class TestRatisPipelineLeader {
cluster.waitForClusterToBeReady();
}
- @AfterClass
+ @AfterAll
public static void shutdown() throws Exception {
if (cluster != null) {
cluster.shutdown();
}
}
- @Test(timeout = 120000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 120000)
public void testLeaderIdUsedOnFirstCall() throws Exception {
List<Pipeline> pipelines = cluster.getStorageContainerManager()
.getPipelineManager().getPipelines(RatisReplicationConfig.getInstance(
@@ -107,7 +108,7 @@ public class TestRatisPipelineLeader {
"org.apache.ratis.protocol.NotLeaderException"));
}
- @Test(timeout = 120000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 120000)
public void testLeaderIdAfterLeaderChange() throws Exception {
List<Pipeline> pipelines = cluster.getStorageContainerManager()
.getPipelineManager().getPipelines(RatisReplicationConfig.getInstance(
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshot.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshot.java
index f60d46b..50bd698 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshot.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestSCMInstallSnapshot.java
@@ -37,10 +37,12 @@ import org.apache.hadoop.hdds.utils.db.DBStore;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.ozone.test.GenericTestUtils;
-import org.junit.AfterClass;
+import org.apache.ozone.test.tag.Flaky;
+
+import org.junit.jupiter.api.AfterAll;
import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.net.InetSocketAddress;
@@ -57,7 +59,7 @@ public class TestSCMInstallSnapshot {
private static MiniOzoneCluster cluster;
private static OzoneConfiguration conf;
- @BeforeClass
+ @BeforeAll
public static void setup() throws Exception {
conf = new OzoneConfiguration();
conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, true);
@@ -72,7 +74,7 @@ public class TestSCMInstallSnapshot {
cluster.waitForClusterToBeReady();
}
- @AfterClass
+ @AfterAll
public static void shutdown() throws Exception {
if (cluster != null) {
cluster.shutdown();
@@ -117,6 +119,7 @@ public class TestSCMInstallSnapshot {
}
@Test
+ @Flaky("HDDS-6116")
public void testInstallCheckPoint() throws Exception {
DBCheckpoint checkpoint = downloadSnapshot();
StorageContainerManager scm = cluster.getStorageContainerManager();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
index ce90783..14523db 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/container/TestContainerStateManagerIntegration.java
@@ -38,11 +38,11 @@ import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
import org.apache.hadoop.ozone.common.statemachine.InvalidStateTransitionException;
import org.apache.hadoop.ozone.container.common.SCMTestUtils;
import org.apache.hadoop.security.authentication.client.AuthenticationException;
-import org.junit.After;
+import org.junit.jupiter.api.AfterEach;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,7 +54,7 @@ import java.util.concurrent.TimeoutException;
/**
* Tests for ContainerStateManager.
*/
-@Ignore
+@Flaky("HDDS-1159")
public class TestContainerStateManagerIntegration {
private static final Logger LOG =
@@ -69,7 +69,7 @@ public class TestContainerStateManagerIntegration {
private Set<ContainerID> excludedContainerIDS;
- @Before
+ @BeforeEach
public void setup() throws Exception {
conf = new OzoneConfiguration();
numContainerPerOwnerInPipeline =
@@ -85,7 +85,7 @@ public class TestContainerStateManagerIntegration {
excludedContainerIDS = new HashSet<>();
}
- @After
+ @AfterEach
public void cleanUp() {
if (cluster != null) {
cluster.shutdown();
@@ -278,7 +278,7 @@ public class TestContainerStateManagerIntegration {
}
@Test
- @Ignore("TODO:HDDS-1159")
+ @Flaky("TODO:HDDS-1159")
public void testGetMatchingContainerMultipleThreads()
throws IOException, InterruptedException {
ContainerWithPipeline container1 = scm.getClientProtocolServer().
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java
index d885e53..047cf8d 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestLeaderChoosePolicy.java
@@ -25,13 +25,15 @@ import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.ozone.test.GenericTestUtils;
import org.apache.ozone.test.LambdaTestUtils;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import java.util.List;
import java.util.concurrent.TimeoutException;
+import java.util.concurrent.TimeUnit;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
@@ -44,7 +46,7 @@ import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_DATANODE_PIPELINE_L
/**
* Tests for LeaderChoosePolicy.
*/
-@Ignore
+@Disabled("This test was never enabled")
public class TestLeaderChoosePolicy {
private MiniOzoneCluster cluster;
@@ -68,7 +70,7 @@ public class TestLeaderChoosePolicy {
pipelineManager = scm.getPipelineManager();
}
- @After
+ @AfterEach
public void cleanup() {
cluster.shutdown();
}
@@ -100,7 +102,7 @@ public class TestLeaderChoosePolicy {
}
}
- @Test(timeout = 360000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 360000)
public void testRestoreSuggestedLeader() throws Exception {
conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false);
conf.set(OZONE_SCM_PIPELINE_LEADER_CHOOSING_POLICY,
@@ -149,7 +151,7 @@ public class TestLeaderChoosePolicy {
}
}
- @Test(timeout = 360000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 360000)
public void testMinLeaderCountChoosePolicy() throws Exception {
conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false);
conf.set(OZONE_SCM_PIPELINE_LEADER_CHOOSING_POLICY,
@@ -192,7 +194,7 @@ public class TestLeaderChoosePolicy {
}
}
- @Test(timeout = 60000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 60000)
public void testDefaultLeaderChoosePolicy() throws Exception {
conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false);
conf.set(OZONE_SCM_PIPELINE_LEADER_CHOOSING_POLICY,
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java
index 074a1c3..e212692 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestPipelineClose.java
@@ -44,11 +44,12 @@ import org.apache.hadoop.ozone.container.common.transport.server.ratis.XceiverSe
import org.apache.hadoop.ozone.container.ozoneimpl.OzoneContainer;
import org.apache.ozone.test.GenericTestUtils;
import org.apache.ratis.protocol.RaftGroupId;
-import org.junit.After;
+import org.junit.jupiter.api.AfterEach;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import org.mockito.ArgumentCaptor;
import org.mockito.Mockito;
@@ -59,20 +60,12 @@ import java.util.UUID;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
-import org.junit.Rule;
-import org.junit.rules.Timeout;
-
/**
* Tests for Pipeline Closing.
*/
+@Timeout(300)
public class TestPipelineClose {
- /**
- * Set a timeout for each test.
- */
- @Rule
- public Timeout timeout = Timeout.seconds(300);
-
private MiniOzoneCluster cluster;
private OzoneConfiguration conf;
private StorageContainerManager scm;
@@ -86,7 +79,7 @@ public class TestPipelineClose {
*
* @throws IOException
*/
- @Before
+ @BeforeEach
public void init() throws Exception {
conf = new OzoneConfiguration();
cluster = MiniOzoneCluster.newBuilder(conf).setNumDatanodes(3).build();
@@ -113,7 +106,7 @@ public class TestPipelineClose {
/**
* Shutdown MiniDFSCluster.
*/
- @After
+ @AfterEach
public void shutdown() {
if (cluster != null) {
cluster.shutdown();
@@ -205,7 +198,7 @@ public class TestPipelineClose {
}
@Test
- @Ignore("HDDS-5604")
+ @Flaky("HDDS-5604")
public void testPipelineCloseWithLogFailure() throws IOException {
EventQueue eventQ = (EventQueue) scm.getEventQueue();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java
index 7ac5b00..bf4e0c7 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/pipeline/TestRatisPipelineCreateAndDestroy.java
@@ -29,10 +29,11 @@ import org.apache.hadoop.hdds.scm.server.StorageContainerManager;
import org.apache.hadoop.ozone.HddsDatanodeService;
import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.ozone.test.GenericTestUtils;
-import org.junit.After;
+import org.junit.jupiter.api.AfterEach;
import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import java.io.IOException;
import java.util.ArrayList;
@@ -47,7 +48,7 @@ import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_STALENODE_INTER
/**
* Tests for RatisPipelineUtils.
*/
-@Ignore
+@Disabled("HDDS-3419")
public class TestRatisPipelineCreateAndDestroy {
private MiniOzoneCluster cluster;
@@ -70,12 +71,12 @@ public class TestRatisPipelineCreateAndDestroy {
pipelineManager = scm.getPipelineManager();
}
- @After
+ @AfterEach
public void cleanup() {
cluster.shutdown();
}
- @Test(timeout = 180000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 180000)
public void testAutomaticPipelineCreationOnPipelineDestroy()
throws Exception {
int numOfDatanodes = 6;
@@ -96,7 +97,7 @@ public class TestRatisPipelineCreateAndDestroy {
waitForPipelines(2);
}
- @Test(timeout = 180000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 180000)
public void testAutomaticPipelineCreationDisablingFactorONE()
throws Exception {
conf.setBoolean(OZONE_SCM_PIPELINE_AUTO_CREATE_FACTOR_ONE, false);
@@ -119,7 +120,7 @@ public class TestRatisPipelineCreateAndDestroy {
waitForPipelines(2);
}
- @Test(timeout = 180000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 180000)
public void testPipelineCreationOnNodeRestart() throws Exception {
conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL,
5, TimeUnit.SECONDS);
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java
index 800992d..daeb098 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/upgrade/TestHDDSUpgrade.java
@@ -85,28 +85,29 @@ import org.apache.hadoop.ozone.upgrade.UpgradeFinalizer.StatusAndMessages;
import org.apache.hadoop.security.authentication.client.AuthenticationException;
import org.apache.ozone.test.GenericTestUtils;
import org.apache.ozone.test.LambdaTestUtils;
-import org.junit.After;
-import org.junit.AfterClass;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.AfterAll;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.apache.ozone.test.tag.Slow;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Test SCM and DataNode Upgrade sequence.
*/
+@Timeout(11000)
+@Flaky({"HDDS-6028", "HDDS-6049"})
+@Slow
public class TestHDDSUpgrade {
/**
* Set a timeout for each test.
*/
- @Rule
- public Timeout timeout = new Timeout(11000000);
private static final Logger LOG =
LoggerFactory.getLogger(TestHDDSUpgrade.class);
private static final int NUM_DATA_NODES = 3;
@@ -131,17 +132,17 @@ public class TestHDDSUpgrade {
*
* @throws IOException
*/
- @Before
+ @BeforeEach
public void setUp() throws Exception {
init();
}
- @After
+ @AfterEach
public void tearDown() throws Exception {
shutdown();
}
- @BeforeClass
+ @BeforeAll
public static void initClass() {
OzoneConfiguration conf = new OzoneConfiguration();
conf.setTimeDuration(HDDS_PIPELINE_REPORT_INTERVAL, 1000,
@@ -165,7 +166,7 @@ public class TestHDDSUpgrade {
clusterProvider = new MiniOzoneClusterProvider(conf, builder, 100);
}
- @AfterClass
+ @AfterAll
public static void afterClass() throws InterruptedException {
clusterProvider.shutdown();
}
@@ -854,7 +855,6 @@ public class TestHDDSUpgrade {
* Upgrade execution points as defined in
* UpgradeFinalizer:UpgradeTestInjectionPoints.
*/
- @Ignore
@Test
public void testDataNodeFailuresDuringDataNodeUpgrade()
throws Exception {
@@ -899,7 +899,6 @@ public class TestHDDSUpgrade {
* through upgrade-finalization. This test covers all the combinations of
* SCM-Upgrade-execution points and DataNode-Upgrade-execution points.
*/
- @Ignore
@Test
public void testAllPossibleDataNodeFailuresAndSCMFailures()
throws Exception {
@@ -959,7 +958,6 @@ public class TestHDDSUpgrade {
* through upgrade. This test covers all the combinations of
* SCM-Upgrade-execution points.
*/
- @Ignore
@Test
public void testDataNodeAndSCMFailuresTogetherDuringSCMUpgrade()
throws Exception {
@@ -998,7 +996,6 @@ public class TestHDDSUpgrade {
* through upgrade. This test covers all the combinations of
* DataNode-Upgrade-execution points.
*/
- @Ignore
@Test
public void testDataNodeAndSCMFailuresTogetherDuringDataNodeUpgrade()
throws Exception {
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java
index 556af06..158cf10 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/MiniOzoneHAClusterImpl.java
@@ -1159,4 +1159,4 @@ public class MiniOzoneHAClusterImpl extends MiniOzoneClusterImpl {
}
}
}
-}
\ No newline at end of file
+}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java
index b52d4df..2f4df63 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/TestMiniOzoneCluster.java
@@ -49,37 +49,33 @@ import org.apache.hadoop.ozone.container.common.volume.StorageVolume;
import org.apache.hadoop.ozone.container.ozoneimpl.TestOzoneContainer;
import org.apache.hadoop.test.PathUtils;
import org.apache.hadoop.test.TestGenericTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.RandomUtils;
import static org.apache.hadoop.hdds.protocol.DatanodeDetails.Port;
import static org.apache.hadoop.hdds.protocol.MockDatanodeDetails.randomDatanodeDetails;
import static org.apache.hadoop.ozone.OzoneConfigKeys.DFS_CONTAINER_RATIS_IPC_RANDOM_PORT;
-import org.junit.After;
-import org.junit.AfterClass;
+
import org.junit.Assert;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import org.yaml.snakeyaml.Yaml;
/**
* Test cases for mini ozone cluster.
*/
+@Timeout(300)
public class TestMiniOzoneCluster {
- /**
- * Set a timeout for each test.
- */
- @Rule
- public Timeout timeout = Timeout.seconds(300);
-
private MiniOzoneCluster cluster;
private static OzoneConfiguration conf;
@@ -87,7 +83,7 @@ public class TestMiniOzoneCluster {
private static final File WRITE_TMP = new File(TEST_ROOT, "write");
private static final File READ_TMP = new File(TEST_ROOT, "read");
- @BeforeClass
+ @BeforeAll
public static void setup() {
conf = new OzoneConfiguration();
conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, TEST_ROOT.toString());
@@ -97,20 +93,21 @@ public class TestMiniOzoneCluster {
READ_TMP.mkdirs();
}
- @After
+ @AfterEach
public void cleanup() {
if (cluster != null) {
cluster.shutdown();
}
}
- @AfterClass
+ @AfterAll
public static void afterClass() {
FileUtils.deleteQuietly(WRITE_TMP);
FileUtils.deleteQuietly(READ_TMP);
}
- @Test(timeout = 60000)
+ @Test
+ @Flaky("HDDS-6112")
public void testStartMultipleDatanodes() throws Exception {
final int numberOfNodes = 3;
cluster = MiniOzoneCluster.newBuilder(conf)
@@ -305,7 +302,8 @@ public class TestMiniOzoneCluster {
* Test that a DN can register with SCM even if it was started before the SCM.
* @throws Exception
*/
- @Test (timeout = 100000)
+ @Test @Timeout(100)
+ @Flaky("HDDS-6111")
public void testDNstartAfterSCM() throws Exception {
// Start a cluster with 3 DN
cluster = MiniOzoneCluster.newBuilder(conf)
@@ -351,7 +349,7 @@ public class TestMiniOzoneCluster {
* Test that multiple datanode directories are created in MiniOzoneCluster.
* @throws Exception
*/
- @Test (timeout = 60000)
+ @Test @Timeout(60)
public void testMultipleDataDirs() throws Exception {
// Start a cluster with 3 DN and configure reserved space in each DN
String reservedSpace = "1B";
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailures.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailures.java
index 7d7d01b..2b23808 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailures.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailures.java
@@ -47,31 +47,28 @@ import org.apache.hadoop.ozone.client.io.KeyOutputStream;
import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.container.ContainerTestHelper;
import org.apache.hadoop.ozone.container.TestHelper;
+import org.apache.ozone.test.tag.Flaky;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_SCM_WATCHER_TIMEOUT;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_DEADNODE_INTERVAL;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_STALENODE_INTERVAL;
+
import org.apache.ratis.protocol.exceptions.GroupMismatchException;
import org.apache.ratis.protocol.exceptions.RaftRetryFailureException;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
/**
* Tests failure detection and handling in BlockOutputStream Class.
*/
+@Timeout(300)
+@Flaky("HDDS-1967")
public class TestBlockOutputStreamWithFailures {
- /**
- * Set a timeout for each test.
- */
- @Rule
- public Timeout timeout = Timeout.seconds(300);
-
private MiniOzoneCluster cluster;
private OzoneConfiguration conf = new OzoneConfiguration();
private OzoneClient client;
@@ -91,7 +88,7 @@ public class TestBlockOutputStreamWithFailures {
*
* @throws IOException
*/
- @Before
+ @BeforeEach
public void init() throws Exception {
chunkSize = 100;
flushSize = 2 * chunkSize;
@@ -153,7 +150,7 @@ public class TestBlockOutputStreamWithFailures {
/**
* Shutdown MiniDFSCluster.
*/
- @After
+ @AfterEach
public void shutdown() {
if (cluster != null) {
cluster.shutdown();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailuresFlushDelay.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailuresFlushDelay.java
index b58d8c8..a8cd615 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailuresFlushDelay.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestBlockOutputStreamWithFailuresFlushDelay.java
@@ -47,32 +47,28 @@ import org.apache.hadoop.ozone.client.io.KeyOutputStream;
import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.container.ContainerTestHelper;
import org.apache.hadoop.ozone.container.TestHelper;
+import org.apache.ozone.test.tag.Flaky;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_SCM_WATCHER_TIMEOUT;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_DEADNODE_INTERVAL;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_STALENODE_INTERVAL;
+
import org.apache.ratis.protocol.exceptions.GroupMismatchException;
import org.apache.ratis.protocol.exceptions.RaftRetryFailureException;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
/**
* Tests failure detection by set flush delay and handling in
* BlockOutputStream Class.
*/
+@Timeout(300)
public class TestBlockOutputStreamWithFailuresFlushDelay {
- /**
- * Set a timeout for each test.
- */
- @Rule
- public Timeout timeout = Timeout.seconds(300);
-
private MiniOzoneCluster cluster;
private OzoneConfiguration conf = new OzoneConfiguration();
private OzoneClient client;
@@ -92,7 +88,7 @@ public class TestBlockOutputStreamWithFailuresFlushDelay {
*
* @throws IOException
*/
- @Before
+ @BeforeEach
public void init() throws Exception {
chunkSize = 100;
flushSize = 2 * chunkSize;
@@ -154,7 +150,7 @@ public class TestBlockOutputStreamWithFailuresFlushDelay {
/**
* Shutdown MiniDFSCluster.
*/
- @After
+ @AfterEach
public void shutdown() {
if (cluster != null) {
cluster.shutdown();
@@ -674,6 +670,7 @@ public class TestBlockOutputStreamWithFailuresFlushDelay {
}
@Test
+ @Flaky("HDDS-6113")
public void testDatanodeFailureWithSingleNodeRatis() throws Exception {
String keyName = getKeyName();
OzoneOutputStream key =
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailureOnRead.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailureOnRead.java
index 3fbd66a..005562d 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailureOnRead.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailureOnRead.java
@@ -46,27 +46,29 @@ import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.container.ozoneimpl.TestOzoneContainer;
import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfo;
import org.apache.ozone.test.GenericTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_COMMAND_STATUS_REPORT_INTERVAL;
import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_CONTAINER_REPORT_INTERVAL;
import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_PIPELINE_REPORT_INTERVAL;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_SCM_WATCHER_TIMEOUT;
+import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_DATANODE_PIPELINE_LIMIT;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_PIPELINE_DESTROY_TIMEOUT;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_STALENODE_INTERVAL;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.ratis.grpc.server.GrpcLogAppender;
-import org.junit.After;
+import org.junit.jupiter.api.AfterEach;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
/**
* Test to verify pipeline is closed on readStateMachine failure.
*/
-@Ignore("see HDDS-3294")
+@Flaky("see HDDS-3294")
public class TestContainerStateMachineFailureOnRead {
private MiniOzoneCluster cluster;
private ObjectStore objectStore;
@@ -74,7 +76,7 @@ public class TestContainerStateMachineFailureOnRead {
private String bucketName;
private OzoneConfiguration conf;
- @Before
+ @BeforeEach
public void setup() throws Exception {
conf = new OzoneConfiguration();
String path = GenericTestUtils
@@ -92,6 +94,7 @@ public class TestContainerStateMachineFailureOnRead {
conf.setTimeDuration(OZONE_SCM_STALENODE_INTERVAL, 1200, TimeUnit.SECONDS);
conf.setTimeDuration(OZONE_SCM_PIPELINE_DESTROY_TIMEOUT, 1000,
TimeUnit.SECONDS);
+ conf.setInt(OZONE_DATANODE_PIPELINE_LIMIT, 1);
DatanodeRatisServerConfig ratisServerConfig =
conf.getObject(DatanodeRatisServerConfig.class);
ratisServerConfig.setFollowerSlownessTimeout(Duration.ofSeconds(1000));
@@ -128,14 +131,14 @@ public class TestContainerStateMachineFailureOnRead {
Logger.getLogger(GrpcLogAppender.class).setLevel(Level.WARN);
}
- @After
+ @AfterEach
public void teardown() throws Exception {
if (cluster != null) {
cluster.shutdown();
}
}
- @Test(timeout = 300000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 300000)
@SuppressWarnings("squid:S3655")
public void testReadStateMachineFailureClosesPipeline() throws Exception {
// Stop one follower datanode
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java
index 78a73cf..442310b 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestContainerStateMachineFailures.java
@@ -75,6 +75,7 @@ import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfo;
import org.apache.hadoop.ozone.protocol.commands.CloseContainerCommand;
import org.apache.hadoop.ozone.protocol.commands.SCMCommand;
import org.apache.ozone.test.LambdaTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_COMMAND_STATUS_REPORT_INTERVAL;
@@ -92,17 +93,16 @@ import org.apache.ratis.statemachine.impl.SimpleStateMachineStorage;
import static org.hamcrest.core.Is.is;
import org.apache.ratis.thirdparty.com.google.protobuf.ByteString;
-import org.junit.AfterClass;
import org.junit.Assert;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
/**
* Tests the containerStateMachine failure handling.
*/
-
public class TestContainerStateMachineFailures {
private static MiniOzoneCluster cluster;
@@ -119,7 +119,7 @@ public class TestContainerStateMachineFailures {
*
* @throws IOException
*/
- @BeforeClass
+ @BeforeAll
public static void init() throws Exception {
conf = new OzoneConfiguration();
@@ -177,7 +177,7 @@ public class TestContainerStateMachineFailures {
/**
* Shutdown MiniDFSCluster.
*/
- @AfterClass
+ @AfterAll
public static void shutdown() {
if (cluster != null) {
cluster.shutdown();
@@ -477,6 +477,7 @@ public class TestContainerStateMachineFailures {
}
@Test
+ @Flaky("HDDS-6115")
public void testApplyTransactionIdempotencyWithClosedContainer()
throws Exception {
OzoneOutputStream key =
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClient.java
index 1ca5797..5ef50eb 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClient.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestFailureHandlingByClient.java
@@ -66,24 +66,18 @@ import static org.apache.hadoop.fs.CommonConfigurationKeysPublic.NET_TOPOLOGY_NO
import static org.apache.hadoop.hdds.protocol.proto.HddsProtos.ReplicationFactor.THREE;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_STALENODE_INTERVAL;
-import org.junit.After;
+import org.apache.ozone.test.tag.Flaky;
import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
/**
* Tests Exception handling by Ozone Client.
*/
+@Timeout(300)
public class TestFailureHandlingByClient {
- /**
- * Set a timeout for each test.
- */
- @Rule
- public Timeout timeout = Timeout.seconds(300);
-
private MiniOzoneCluster cluster;
private OzoneConfiguration conf;
private OzoneClient client;
@@ -161,7 +155,7 @@ public class TestFailureHandlingByClient {
/**
* Shutdown MiniDFSCluster.
*/
- @After
+ @AfterEach
public void shutdown() {
if (cluster != null) {
cluster.shutdown();
@@ -421,7 +415,7 @@ public class TestFailureHandlingByClient {
}
@Test
- @Ignore("HDDS-3298")
+ @Flaky("HDDS-3298")
public void testDatanodeExclusionWithMajorityCommit() throws Exception {
startCluster();
String keyName = UUID.randomUUID().toString();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java
index 3e7782d..5bdd344 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClient.java
@@ -24,31 +24,25 @@ import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.scm.ScmConfigKeys;
import org.apache.hadoop.ozone.OzoneConfigKeys;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Rule;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Timeout;
/**
* This class is to test all the public facing APIs of Ozone Client.
*/
+@Timeout(300)
public class TestOzoneRpcClient extends TestOzoneRpcClientAbstract {
/**
- * Set a timeout for each test.
- */
- @Rule
- public Timeout timeout = Timeout.seconds(300);
-
- /**
* Create a MiniOzoneCluster for testing.
* <p>
* Ozone is made active by setting OZONE_ENABLED = true
*
* @throws IOException
*/
- @BeforeClass
+ @BeforeAll
public static void init() throws Exception {
OzoneConfiguration conf = new OzoneConfiguration();
conf.setInt(ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT, 1);
@@ -61,7 +55,7 @@ public class TestOzoneRpcClient extends TestOzoneRpcClientAbstract {
/**
* Close OzoneClient and shutdown MiniOzoneCluster.
*/
- @AfterClass
+ @AfterAll
public static void shutdown() throws IOException {
shutdownCluster();
}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java
index 92147cf..c1fdefb 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientAbstract.java
@@ -107,6 +107,7 @@ import org.apache.hadoop.ozone.security.acl.OzoneObjInfo;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.ozone.test.GenericTestUtils;
import org.apache.ozone.test.LambdaTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import static java.nio.charset.StandardCharsets.UTF_8;
import org.apache.commons.io.FileUtils;
@@ -130,6 +131,7 @@ import static org.apache.hadoop.ozone.om.exceptions.OMException.ResultCodes.PART
import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLIdentityType.GROUP;
import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLIdentityType.USER;
import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType.READ;
+
import org.junit.Assert;
import static org.apache.hadoop.ozone.security.acl.IAccessAuthorizer.ACLType.WRITE;
@@ -141,9 +143,9 @@ import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.slf4j.event.Level.DEBUG;
-import org.junit.FixMethodOrder;
-import org.junit.Test;
-import org.junit.runners.MethodSorters;
+import org.junit.jupiter.api.MethodOrderer;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestMethodOrder;
/**
* This is an abstract class to test all the public facing APIs of Ozone
@@ -152,7 +154,7 @@ import org.junit.runners.MethodSorters;
* requests directly to OzoneManager. {@link TestOzoneRpcClientWithRatis}
* tests the Ozone Client by submitting requests to OM's Ratis server.
*/
-@FixMethodOrder(MethodSorters.NAME_ASCENDING)
+@TestMethodOrder(MethodOrderer.MethodName.class)
public abstract class TestOzoneRpcClientAbstract {
private static MiniOzoneCluster cluster = null;
@@ -1581,6 +1583,7 @@ public abstract class TestOzoneRpcClientAbstract {
// Make this executed at last, for it has some side effect to other UTs
@Test
+ @Flaky("HDDS-6151")
public void testZReadKeyWithUnhealthyContainerReplica() throws Exception {
String volumeName = UUID.randomUUID().toString();
String bucketName = UUID.randomUUID().toString();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientWithRatis.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientWithRatis.java
index d44c4d0..362a218 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientWithRatis.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneRpcClientWithRatis.java
@@ -37,10 +37,10 @@ import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.common.OzoneChecksumException;
import org.apache.hadoop.ozone.om.OMConfigKeys;
import org.apache.hadoop.ozone.om.helpers.OmKeyArgs;
-import org.junit.AfterClass;
+import org.junit.jupiter.api.AfterAll;
import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.hadoop.hdds.client.ReplicationFactor.THREE;
@@ -60,7 +60,7 @@ public class TestOzoneRpcClientWithRatis extends TestOzoneRpcClientAbstract {
*
* @throws IOException
*/
- @BeforeClass
+ @BeforeAll
public static void init() throws Exception {
conf = new OzoneConfiguration();
conf.setInt(ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT, 1);
@@ -78,7 +78,7 @@ public class TestOzoneRpcClientWithRatis extends TestOzoneRpcClientAbstract {
/**
* Close OzoneClient and shutdown MiniOzoneCluster.
*/
- @AfterClass
+ @AfterAll
public static void shutdown() throws IOException {
shutdownCluster();
}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java
index 2b21a6a..39e4a5c 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestSecureOzoneRpcClient.java
@@ -57,11 +57,11 @@ import org.apache.hadoop.ozone.security.OzoneBlockTokenSecretManager;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.ozone.test.GenericTestUtils;
import org.apache.ozone.test.LambdaTestUtils;
-import org.junit.AfterClass;
+import org.junit.jupiter.api.AfterAll;
import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import java.io.File;
import java.io.IOException;
@@ -97,7 +97,7 @@ public class TestSecureOzoneRpcClient extends TestOzoneRpcClient {
*
* @throws IOException
*/
- @BeforeClass
+ @BeforeAll
public static void init() throws Exception {
testDir = GenericTestUtils.getTestDir(
TestSecureOzoneRpcClient.class.getSimpleName());
@@ -189,7 +189,7 @@ public class TestSecureOzoneRpcClient extends TestOzoneRpcClient {
* 2. writeChunk
* */
@Test
- @Ignore("Needs to be moved out of this class as client setup is static")
+ @Disabled("Needs to be moved out of this class as client setup is static")
public void testKeyOpFailureWithoutBlockToken() throws Exception {
String volumeName = UUID.randomUUID().toString();
String bucketName = UUID.randomUUID().toString();
@@ -340,7 +340,7 @@ public class TestSecureOzoneRpcClient extends TestOzoneRpcClient {
/**
* Close OzoneClient and shutdown MiniOzoneCluster.
*/
- @AfterClass
+ @AfterAll
public static void shutdown() throws IOException {
if (ozClient != null) {
ozClient.close();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestWatchForCommit.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestWatchForCommit.java
index aa6ff93..08a6918 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestWatchForCommit.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestWatchForCommit.java
@@ -59,19 +59,21 @@ import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.container.ContainerTestHelper;
import org.apache.hadoop.ozone.container.TestHelper;
import org.apache.ozone.test.GenericTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_PIPELINE_DESTROY_TIMEOUT;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_STALENODE_INTERVAL;
import org.apache.ratis.protocol.exceptions.GroupMismatchException;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
/**
* This class verifies the watchForCommit Handling by xceiverClient.
*/
+@Flaky("HDDS-5818")
public class TestWatchForCommit {
private MiniOzoneCluster cluster;
@@ -95,7 +97,7 @@ public class TestWatchForCommit {
*
* @throws IOException
*/
- @Before
+ @BeforeEach
public void init() throws Exception {
conf = new OzoneConfiguration();
chunkSize = 100;
@@ -157,7 +159,7 @@ public class TestWatchForCommit {
/**
* Shutdown MiniDFSCluster.
*/
- @After
+ @AfterEach
public void shutdown() {
if (cluster != null) {
cluster.shutdown();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestBlockDeletion.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestBlockDeletion.java
index dab2bcb..e264f48 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestBlockDeletion.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestBlockDeletion.java
@@ -50,6 +50,7 @@ import org.apache.hadoop.ozone.container.common.impl.ContainerData;
import org.apache.hadoop.ozone.container.common.impl.ContainerSet;
import org.apache.hadoop.ozone.container.common.interfaces.Container;
import org.apache.hadoop.ozone.container.common.statemachine.DatanodeConfiguration;
+import org.apache.hadoop.ozone.container.common.utils.ReferenceCountedDB;
import org.apache.hadoop.ozone.container.keyvalue.KeyValueContainerData;
import org.apache.hadoop.ozone.container.keyvalue.helpers.BlockUtils;
import org.apache.hadoop.ozone.om.OzoneManager;
@@ -59,11 +60,10 @@ import org.apache.hadoop.ozone.om.helpers.OmKeyLocationInfoGroup;
import org.apache.hadoop.ozone.om.protocol.OzoneManagerProtocol;
import org.apache.ozone.test.GenericTestUtils;
import org.apache.ozone.test.GenericTestUtils.LogCapturer;
-import org.apache.hadoop.ozone.container.common.utils.ReferenceCountedDB;
-import org.junit.After;
+import org.junit.jupiter.api.AfterEach;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.event.Level;
@@ -110,7 +110,7 @@ public class TestBlockDeletion {
private File baseDir;
private ScmBlockDeletingServiceMetrics metrics;
- @Before
+ @BeforeEach
public void init() throws Exception {
conf = new OzoneConfiguration();
conf.setBoolean(ScmConfigKeys.OZONE_SCM_HA_ENABLE_KEY, false);
@@ -167,7 +167,7 @@ public class TestBlockDeletion {
.getMetrics();
}
- @After
+ @AfterEach
public void cleanup() throws IOException {
if (cluster != null) {
cluster.shutdown();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerByPipeline.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerByPipeline.java
index 7ff5238..3a39fe1 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerByPipeline.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/common/statemachine/commandhandler/TestCloseContainerByPipeline.java
@@ -42,11 +42,12 @@ import org.apache.hadoop.ozone.protocol.commands.CloseContainerCommand;
import org.apache.hadoop.ozone.protocol.commands.SCMCommand;
import org.apache.ozone.test.GenericTestUtils;
import org.apache.hadoop.ozone.container.common.utils.ReferenceCountedDB;
-import org.junit.AfterClass;
+import org.junit.jupiter.api.AfterAll;
import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.ArrayList;
@@ -62,7 +63,7 @@ import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_DATANODE_PIPELINE_L
/**
* Test container closing.
*/
-@Ignore
+@Flaky("HDDS-3263")
public class TestCloseContainerByPipeline {
private static MiniOzoneCluster cluster;
@@ -77,7 +78,7 @@ public class TestCloseContainerByPipeline {
*
* @throws IOException
*/
- @BeforeClass
+ @BeforeAll
public static void init() throws Exception {
conf = new OzoneConfiguration();
conf.set(ScmConfigKeys.OZONE_SCM_PIPELINE_OWNER_CONTAINER_COUNT, "1");
@@ -98,7 +99,7 @@ public class TestCloseContainerByPipeline {
/**
* Shutdown MiniDFSCluster.
*/
- @AfterClass
+ @AfterAll
public static void shutdown() {
if (cluster != null) {
cluster.shutdown();
@@ -284,6 +285,7 @@ public class TestCloseContainerByPipeline {
}
}
+ @Disabled("Failing with timeout")
@Test
public void testQuasiCloseTransitionViaRatis()
throws IOException, TimeoutException, InterruptedException {
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java
index 4240fca..9e27e91 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/ozoneimpl/TestOzoneContainer.java
@@ -32,12 +32,13 @@ import org.apache.hadoop.hdds.scm.XceiverClientSpi;
import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
import org.apache.hadoop.ozone.container.common.statemachine.DatanodeStateMachine;
import org.apache.hadoop.ozone.container.common.statemachine.StateContext;
+import org.apache.ozone.test.tag.Flaky;
import org.junit.Assert;
-import org.junit.Ignore;
import org.junit.Rule;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
+import org.junit.jupiter.migrationsupport.rules.EnableRuleMigrationSupport;
import org.junit.rules.TemporaryFolder;
-import org.junit.rules.Timeout;
import org.mockito.Mockito;
import java.util.HashMap;
@@ -53,13 +54,10 @@ import static org.apache.hadoop.hdds.scm.ScmConfigKeys.HDDS_DATANODE_DIR_KEY;
/**
* Tests ozone containers.
*/
-@Ignore
+@EnableRuleMigrationSupport
+@Flaky("HDDS-2263")
+@Timeout(300)
public class TestOzoneContainer {
- /**
- * Set the timeout for every test.
- */
- @Rule
- public Timeout testTimeout = Timeout.seconds(300);
@Rule
public TemporaryFolder tempFolder = new TemporaryFolder();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/server/TestContainerServer.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/server/TestContainerServer.java
index c2720d9..57e291e 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/server/TestContainerServer.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/container/server/TestContainerServer.java
@@ -40,6 +40,7 @@ import org.apache.hadoop.hdds.scm.pipeline.Pipeline;
import org.apache.hadoop.hdds.security.x509.SecurityConfig;
import org.apache.hadoop.hdds.security.x509.certificate.client.CertificateClient;
import org.apache.hadoop.hdds.security.x509.certificate.client.DNCertificateClient;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
import org.apache.hadoop.ozone.OzoneConfigKeys;
import org.apache.hadoop.ozone.RatisTestHelper;
import org.apache.hadoop.ozone.container.ContainerTestHelper;
@@ -63,27 +64,28 @@ import com.google.common.collect.Maps;
import static org.apache.hadoop.hdds.protocol.MockDatanodeDetails.randomDatanodeDetails;
import org.apache.ratis.rpc.RpcType;
import static org.apache.ratis.rpc.SupportedRpcType.GRPC;
-import static org.apache.ratis.rpc.SupportedRpcType.NETTY;
import org.apache.ratis.util.function.CheckedBiConsumer;
import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeAll;
+import org.apache.ozone.test.tag.Slow;
+import org.junit.jupiter.api.Disabled;
+import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
import static org.mockito.Mockito.mock;
/**
* Test Containers.
*/
-@Ignore("Takes too long to run this test. Ignoring for time being.")
+@Slow
public class TestContainerServer {
static final String TEST_DIR = GenericTestUtils.getTestDir("dfs")
.getAbsolutePath() + File.separator;
private static final OzoneConfiguration CONF = new OzoneConfiguration();
private static CertificateClient caClient;
- @BeforeClass
+ @BeforeAll
public static void setup() {
+ DefaultMetricsSystem.setMiniClusterMode(true);
CONF.set(HddsConfigKeys.HDDS_METADATA_DIR_NAME, TEST_DIR);
caClient = new DNCertificateClient(new SecurityConfig(CONF));
}
@@ -107,12 +109,6 @@ public class TestContainerServer {
}
@Test
- public void testClientServerRatisNetty() throws Exception {
- runTestClientServerRatis(NETTY, 1);
- runTestClientServerRatis(NETTY, 3);
- }
-
- @Test
public void testClientServerRatisGrpc() throws Exception {
runTestClientServerRatis(GRPC, 1);
runTestClientServerRatis(GRPC, 3);
@@ -181,6 +177,7 @@ public class TestContainerServer {
}
}
+ @Disabled("Fails with StatusRuntimeException: UNKNOWN")
@Test
public void testClientServerWithContainerDispatcher() throws Exception {
XceiverServerGrpc server = null;
@@ -282,4 +279,4 @@ public class TestContainerServer {
Map<Long, Long> container2BCSIDMap) {
}
}
-}
\ No newline at end of file
+}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java
index da85364..cd6af31 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestRandomKeyGenerator.java
@@ -26,11 +26,12 @@ import org.apache.hadoop.hdds.conf.DatanodeRatisServerConfig;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.ratis.conf.RatisClientConfig;
import org.apache.hadoop.ozone.MiniOzoneCluster;
+import org.apache.ozone.test.tag.Flaky;
-import org.junit.AfterClass;
import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
/**
* Tests Freon, with MiniOzoneCluster.
@@ -46,7 +47,7 @@ public class TestRandomKeyGenerator {
* Ozone is made active by setting OZONE_ENABLED = true
*
*/
- @BeforeClass
+ @BeforeAll
public static void init() throws Exception {
conf = new OzoneConfiguration();
DatanodeRatisServerConfig ratisServerConfig =
@@ -68,7 +69,7 @@ public class TestRandomKeyGenerator {
/**
* Shutdown MiniDFSCluster.
*/
- @AfterClass
+ @AfterAll
public static void shutdown() {
if (cluster != null) {
cluster.shutdown();
@@ -178,7 +179,7 @@ public class TestRandomKeyGenerator {
}
@Test
- @org.junit.Ignore("HDDS-5993")
+ @Flaky("HDDS-5993")
public void cleanObjectsTest() throws Exception {
RandomKeyGenerator randomKeyGenerator =
new RandomKeyGenerator((OzoneConfiguration) cluster.getConf());
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
index bb808cf..0fe9559 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestAddRemoveOzoneManager.java
@@ -44,14 +44,13 @@ import org.apache.hadoop.ozone.om.ratis.OzoneManagerRatisServer;
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.hadoop.util.StringUtils;
import org.apache.ozone.test.GenericTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import org.apache.ratis.grpc.server.GrpcLogAppender;
import org.apache.ratis.server.leader.FollowerInfo;
-import org.junit.After;
import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import org.slf4j.event.Level;
import static org.apache.hadoop.ozone.OzoneConsts.SCM_DUMMY_SERVICE_ID;
@@ -61,14 +60,9 @@ import static org.apache.hadoop.ozone.om.TestOzoneManagerHA.createKey;
/**
* Test for OM bootstrap process.
*/
+@Timeout(500)
public class TestAddRemoveOzoneManager {
- @Rule
- public ExpectedException exception = ExpectedException.none();
-
- @Rule
- public Timeout timeout = new Timeout(5000_000);
-
private MiniOzoneHAClusterImpl cluster = null;
private ObjectStore objectStore;
private OzoneConfiguration conf;
@@ -113,7 +107,7 @@ public class TestAddRemoveOzoneManager {
.getOmStateMachine().getLastAppliedTermIndex().getIndex();
}
- @After
+ @AfterEach
public void shutdown() throws Exception {
if (cluster != null) {
cluster.shutdown();
@@ -214,6 +208,7 @@ public class TestAddRemoveOzoneManager {
* 2. Force bootstrap without upating config on any OM -> fail
*/
@Test
+ @Flaky("HDDS-6077")
public void testBootstrapWithoutConfigUpdate() throws Exception {
// Setup 1 node cluster
setupCluster(1);
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
index 2652317..7a10ef5 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
@@ -37,14 +37,11 @@ import org.apache.hadoop.ozone.client.rpc.RpcClient;
import org.apache.hadoop.ozone.om.ha.OMFailoverProxyProvider;
import org.apache.hadoop.ozone.om.ratis.OzoneManagerRatisServerConfig;
import org.apache.ozone.test.GenericTestUtils;
-import org.junit.BeforeClass;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Rule;
import org.junit.Assert;
-
-import org.junit.rules.ExpectedException;
-import org.junit.rules.Timeout;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Timeout;
import java.io.IOException;
import java.net.ConnectException;
@@ -67,6 +64,7 @@ import static org.junit.Assert.fail;
/**
* Base class for Ozone Manager HA tests.
*/
+@Timeout(300)
public abstract class TestOzoneManagerHA {
private static MiniOzoneHAClusterImpl cluster = null;
@@ -85,11 +83,6 @@ public abstract class TestOzoneManagerHA {
private static final long SNAPSHOT_THRESHOLD = 50;
private static final Duration RETRY_CACHE_DURATION = Duration.ofSeconds(30);
- @Rule
- public ExpectedException exception = ExpectedException.none();
-
- @Rule
- public Timeout timeout = Timeout.seconds(300);
public MiniOzoneHAClusterImpl getCluster() {
return cluster;
@@ -138,7 +131,7 @@ public abstract class TestOzoneManagerHA {
*
* @throws IOException
*/
- @BeforeClass
+ @BeforeAll
public static void init() throws Exception {
conf = new OzoneConfiguration();
clusterId = UUID.randomUUID().toString();
@@ -190,7 +183,7 @@ public abstract class TestOzoneManagerHA {
/**
* Reset cluster between tests.
*/
- @After
+ @AfterEach
public void resetCluster()
throws IOException {
if (cluster != null) {
@@ -201,7 +194,7 @@ public abstract class TestOzoneManagerHA {
/**
* Shutdown MiniDFSCluster after all tests of a class have run.
*/
- @AfterClass
+ @AfterAll
public static void shutdown() {
if (cluster != null) {
cluster.shutdown();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAKeyDeletion.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAKeyDeletion.java
index 137d900..ac3bb67 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAKeyDeletion.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAKeyDeletion.java
@@ -19,7 +19,7 @@ package org.apache.hadoop.ozone.om;
import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.ozone.test.GenericTestUtils;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.util.ArrayList;
import java.util.List;
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAMetadataOnly.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAMetadataOnly.java
index fc4fa36..8df3f87 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAMetadataOnly.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAMetadataOnly.java
@@ -46,8 +46,8 @@ import org.apache.ratis.protocol.RaftClientReply;
import org.apache.ratis.protocol.RaftClientRequest;
import org.apache.ratis.server.RaftServer;
import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.Test;
import javax.management.MBeanInfo;
import javax.management.MBeanServer;
@@ -185,7 +185,7 @@ public class TestOzoneManagerHAMetadataOnly extends TestOzoneManagerHA {
/**
* Test OMFailoverProxyProvider failover on connection exception to OM client.
*/
- @Ignore("This test randomly failing. Let's enable once its fixed.")
+ @Flaky("This test randomly failing. Let's enable once its fixed.")
@Test
public void testOMProxyProviderFailoverOnConnectionFailure()
throws Exception {
@@ -318,7 +318,7 @@ public class TestOzoneManagerHAMetadataOnly extends TestOzoneManagerHA {
}
}
- @Ignore("This test randomly failing. Let's enable once its fixed.")
+ @Flaky("This test randomly failing. Let's enable once its fixed.")
@Test
public void testListVolumes() throws Exception {
String userName = UserGroupInformation.getCurrentUser().getUserName();
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithACL.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithACL.java
index 3af7f01..887c1a8 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithACL.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithACL.java
@@ -23,7 +23,7 @@ import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.hadoop.ozone.security.acl.OzoneObj;
import org.apache.hadoop.ozone.security.acl.OzoneObjInfo;
import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.BitSet;
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java
index 0c2f526..2181fc3 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithData.java
@@ -31,9 +31,9 @@ import org.apache.hadoop.ozone.om.ha.OMFailoverProxyProvider;
import org.apache.hadoop.ozone.om.helpers.OmMultipartInfo;
import org.apache.hadoop.ozone.om.helpers.OmMultipartUploadCompleteInfo;
import org.apache.ozone.test.GenericTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import java.io.IOException;
import java.util.ArrayList;
@@ -61,6 +61,7 @@ public class TestOzoneManagerHAWithData extends TestOzoneManagerHA {
* @throws Exception
*/
@Test
+ @Flaky("HDDS-5994")
public void testAllOMNodesRunningAndOneDown() throws Exception {
createVolumeTest(true);
createKeyTest(true);
@@ -77,7 +78,7 @@ public class TestOzoneManagerHAWithData extends TestOzoneManagerHA {
/**
* Test client request fails when 2 OMs are down.
*/
- @Ignore("This test is failing randomly. It will be enabled after fixing it.")
+ @Flaky("This test is failing randomly. It will be enabled after fixing it.")
@Test
public void testTwoOMNodesDown() throws Exception {
getCluster().stopOzoneManager(1);
@@ -317,6 +318,7 @@ public class TestOzoneManagerHAWithData extends TestOzoneManagerHA {
}
@Test
+ @Flaky("HDDS-6074")
public void testOMRatisSnapshot() throws Exception {
String userName = "user" + RandomStringUtils.randomNumeric(5);
String adminName = "admin" + RandomStringUtils.randomNumeric(5);
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithFailover.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithFailover.java
index a31ed2e..9e35ffe 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithFailover.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHAWithFailover.java
@@ -19,7 +19,7 @@ package org.apache.hadoop.ozone.om;
import org.apache.hadoop.ozone.OzoneConfigKeys;
import org.apache.hadoop.ozone.om.ha.OMFailoverProxyProvider;
import org.junit.Assert;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import static org.apache.hadoop.ozone.MiniOzoneHAClusterImpl.NODE_FAILURE_TIMEOUT;
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java
index 003f970..385b052 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerPrepare.java
@@ -47,16 +47,18 @@ import org.apache.hadoop.ozone.om.exceptions.OMException;
import org.apache.hadoop.ozone.om.helpers.OmKeyInfo;
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.PrepareStatusResponse.PrepareStatus;
import org.apache.ozone.test.LambdaTestUtils;
+import org.apache.ozone.test.tag.Slow;
import org.junit.Assert;
-import org.junit.Ignore;
-import org.junit.Before;
-import org.junit.Test;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Test OM prepare against actual mini cluster.
*/
+@Flaky("HDDS-5990")
public class TestOzoneManagerPrepare extends TestOzoneManagerHA {
private static final String BUCKET = "bucket";
private static final String VOLUME = "volume";
@@ -84,7 +86,7 @@ public class TestOzoneManagerPrepare extends TestOzoneManagerHA {
* Make sure OM is out of Prepare state before executing individual tests.
* @throws Exception
*/
- @Before
+ @BeforeEach
public void initOM() throws Exception {
setup();
submitCancelPrepareRequest();
@@ -204,7 +206,7 @@ public class TestOzoneManagerPrepare extends TestOzoneManagerHA {
assertClusterPrepared(prepareIndex);
}
- @Ignore("Saving on CI time since this is a pessimistic test. We should not " +
+ @Slow("Saving on CI time since this is a pessimistic test. We should not " +
"be able to do anything with 2 OMs down.")
@Test
public void testPrepareFailsWhenTwoOmsAreDown() throws Exception {
@@ -517,4 +519,4 @@ public class TestOzoneManagerPrepare extends TestOzoneManagerHA {
assertClusterPrepared(prepareIndex);
assertRatisLogsCleared();
}
-}
\ No newline at end of file
+}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestScmSafeMode.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestScmSafeMode.java
index 986ba17..d4e14f6 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestScmSafeMode.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestScmSafeMode.java
@@ -69,7 +69,7 @@ import static org.junit.Assert.fail;
/**
* Test Ozone Manager operation in distributed handler scenario.
*/
-@Ignore
+@Ignore("HDDS-3260")
public class TestScmSafeMode {
private static final Logger LOG = LoggerFactory
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestSCMContainerPlacementPolicyMetrics.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestSCMContainerPlacementPolicyMetrics.java
index 6243e4b..30efd2b 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestSCMContainerPlacementPolicyMetrics.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestSCMContainerPlacementPolicyMetrics.java
@@ -41,17 +41,19 @@ import org.apache.hadoop.ozone.client.OzoneClientFactory;
import org.apache.hadoop.ozone.client.OzoneVolume;
import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.om.OMConfigKeys;
-import org.junit.After;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.AfterEach;
import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.Timeout;
import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
+import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import static java.nio.charset.StandardCharsets.UTF_8;
@@ -64,7 +66,7 @@ import static org.apache.hadoop.test.MetricsAsserts.getMetrics;
/**
* Test cases to verify the metrics exposed by SCMPipelineManager.
*/
-@Ignore("HDDS-2961")
+@Flaky("HDDS-2961")
public class TestSCMContainerPlacementPolicyMetrics {
private MiniOzoneCluster cluster;
@@ -72,7 +74,7 @@ public class TestSCMContainerPlacementPolicyMetrics {
private OzoneClient ozClient = null;
private ObjectStore store = null;
- @Before
+ @BeforeEach
public void setup() throws Exception {
OzoneConfiguration conf = new OzoneConfiguration();
conf.set(ScmConfigKeys.OZONE_SCM_CONTAINER_PLACEMENT_IMPL_KEY,
@@ -98,7 +100,7 @@ public class TestSCMContainerPlacementPolicyMetrics {
/**
* Verifies container placement metric.
*/
- @Test(timeout = 60000)
+ @Test @Timeout(unit = TimeUnit.MILLISECONDS, value = 60000)
public void test() throws IOException {
String volumeName = UUID.randomUUID().toString();
String bucketName = UUID.randomUUID().toString();
@@ -155,7 +157,7 @@ public class TestSCMContainerPlacementPolicyMetrics {
Assert.assertTrue(compromiseCount == 0);
}
- @After
+ @AfterEach
public void teardown() {
cluster.shutdown();
}
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestSCMInstallSnapshotWithHA.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestSCMInstallSnapshotWithHA.java
index 6f19722..94ac63f 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestSCMInstallSnapshotWithHA.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/TestSCMInstallSnapshotWithHA.java
@@ -44,6 +44,7 @@ import org.apache.hadoop.ozone.OzoneConsts;
import org.apache.hadoop.hdds.utils.TransactionInfo;
import org.apache.hadoop.hdds.ExitManager;
import org.apache.ozone.test.GenericTestUtils;
+import org.apache.ozone.test.tag.Flaky;
import org.apache.ratis.server.protocol.TermIndex;
import static org.junit.Assert.assertTrue;
@@ -61,6 +62,7 @@ import org.slf4j.event.Level;
* Tests the Ratis snapshot feature in SCM.
*/
@Timeout(500)
+@Flaky("HDDS-5631")
public class TestSCMInstallSnapshotWithHA {
private MiniOzoneHAClusterImpl cluster = null;
diff --git a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestDecommissionAndMaintenance.java b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestDecommissionAndMaintenance.java
index cb91593..2a4ae1f 100644
--- a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestDecommissionAndMaintenance.java
+++ b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/scm/node/TestDecommissionAndMaintenance.java
@@ -41,11 +41,12 @@ import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.TestDataUtil;
import org.apache.hadoop.ozone.client.OzoneBucket;
import org.apache.ozone.test.GenericTestUtils;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
+import org.apache.ozone.test.tag.Flaky;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -85,7 +86,7 @@ import static org.junit.Assert.fail;
/**
* Test from the scmclient for decommission and maintenance.
*/
-
+@Flaky({"HDDS-6028", "HDDS-6049"})
public class TestDecommissionAndMaintenance {
private static final Logger LOG =
LoggerFactory.getLogger(TestDecommissionAndMaintenance.class);
@@ -104,7 +105,7 @@ public class TestDecommissionAndMaintenance {
private static MiniOzoneClusterProvider clusterProvider;
- @BeforeClass
+ @BeforeAll
public static void init() {
OzoneConfiguration conf = new OzoneConfiguration();
final int interval = 100;
@@ -134,14 +135,14 @@ public class TestDecommissionAndMaintenance {
clusterProvider = new MiniOzoneClusterProvider(conf, builder, 8);
}
- @AfterClass
+ @AfterAll
public static void shutdown() throws InterruptedException {
if (clusterProvider != null) {
clusterProvider.shutdown();
}
}
- @Before
+ @BeforeEach
public void setUp() throws Exception {
cluster = clusterProvider.provide();
setManagers();
@@ -149,7 +150,7 @@ public class TestDecommissionAndMaintenance {
scmClient = new ContainerOperationClient(cluster.getConf());
}
- @After
+ @AfterEach
public void tearDown() throws InterruptedException, IOException {
if (cluster != null) {
clusterProvider.destroy(cluster);
diff --git a/hadoop-ozone/interface-client/pom.xml b/hadoop-ozone/interface-client/pom.xml
index 1a204aa..292571b 100644
--- a/hadoop-ozone/interface-client/pom.xml
+++ b/hadoop-ozone/interface-client/pom.xml
@@ -28,6 +28,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<name>Apache Ozone Client Interface</name>
<packaging>jar</packaging>
+ <properties>
+ <maven.test.skip>true</maven.test.skip> <!-- no tests in this module so far -->
+ </properties>
+
<dependencies>
<dependency>
<groupId>com.google.protobuf</groupId>
diff --git a/hadoop-ozone/ozonefs-hadoop2/pom.xml b/hadoop-ozone/ozonefs-hadoop2/pom.xml
index cb80a0e..6a52d09 100644
--- a/hadoop-ozone/ozonefs-hadoop2/pom.xml
+++ b/hadoop-ozone/ozonefs-hadoop2/pom.xml
@@ -26,6 +26,7 @@
<packaging>jar</packaging>
<version>1.3.0-SNAPSHOT</version>
<properties>
+ <maven.test.skip>true</maven.test.skip> <!-- no tests in this module so far -->
<shaded.prefix>org.apache.hadoop.ozone.shaded</shaded.prefix>
</properties>
<dependencies>
diff --git a/hadoop-ozone/ozonefs-hadoop3/pom.xml b/hadoop-ozone/ozonefs-hadoop3/pom.xml
index b446156..f7d2c93 100644
--- a/hadoop-ozone/ozonefs-hadoop3/pom.xml
+++ b/hadoop-ozone/ozonefs-hadoop3/pom.xml
@@ -26,6 +26,7 @@
<packaging>jar</packaging>
<version>1.3.0-SNAPSHOT</version>
<properties>
+ <maven.test.skip>true</maven.test.skip> <!-- no tests in this module so far -->
<shaded.prefix>org.apache.hadoop.ozone.shaded</shaded.prefix>
</properties>
<dependencies>
diff --git a/hadoop-ozone/ozonefs-shaded/pom.xml b/hadoop-ozone/ozonefs-shaded/pom.xml
index 2d09d0a..500f817 100644
--- a/hadoop-ozone/ozonefs-shaded/pom.xml
+++ b/hadoop-ozone/ozonefs-shaded/pom.xml
@@ -27,6 +27,7 @@
<version>1.3.0-SNAPSHOT</version>
<properties>
+ <maven.test.skip>true</maven.test.skip> <!-- no tests in this module so far -->
<shaded.prefix>org.apache.hadoop.ozone.shaded</shaded.prefix>
</properties>
diff --git a/hadoop-ozone/recon-codegen/pom.xml b/hadoop-ozone/recon-codegen/pom.xml
index f258218..3bfaa74 100644
--- a/hadoop-ozone/recon-codegen/pom.xml
+++ b/hadoop-ozone/recon-codegen/pom.xml
@@ -23,6 +23,10 @@
<modelVersion>4.0.0</modelVersion>
<artifactId>ozone-reconcodegen</artifactId>
<name>Apache Ozone Recon CodeGen</name>
+ <properties>
+ <maven.test.skip>true</maven.test.skip> <!-- no tests in this module so far -->
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.apache.ozone</groupId>
diff --git a/pom.xml b/pom.xml
index d8a6252..82582d6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -208,7 +208,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<!-- Plugin versions and config -->
<maven-surefire-plugin.argLine>-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError</maven-surefire-plugin.argLine>
- <maven-surefire-plugin.version>3.0.0-M1</maven-surefire-plugin.version>
+ <maven-surefire-plugin.version>3.0.0-M5</maven-surefire-plugin.version>
<maven-surefire-report-plugin.version>${maven-surefire-plugin.version}</maven-surefire-report-plugin.version>
<maven-failsafe-plugin.version>${maven-surefire-plugin.version}</maven-failsafe-plugin.version>
@@ -1150,6 +1150,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter-migrationsupport</artifactId>
+ <version>${junit.jupiter.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
@@ -2179,6 +2185,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<includes>
<include>org.apache.hadoop.ozone.client.**</include>
</includes>
+ <excludedGroups>flaky | slow</excludedGroups>
</configuration>
</plugin>
</plugins>
@@ -2196,6 +2203,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<include>org.apache.hadoop.fs.ozone.**</include>
<include>org.apache.hadoop.hdds.**</include>
</includes>
+ <excludedGroups>flaky | slow</excludedGroups>
</configuration>
</plugin>
</plugins>
@@ -2215,6 +2223,36 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<excludes>
<exclude>org.apache.hadoop.ozone.client.**</exclude>
</excludes>
+ <excludedGroups>flaky | slow</excludedGroups>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>stable</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludedGroups>flaky | slow</excludedGroups>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>flaky</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <groups>flaky</groups>
+ <excludedGroups>slow</excludedGroups>
</configuration>
</plugin>
</plugins>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ozone.apache.org
For additional commands, e-mail: commits-help@ozone.apache.org