You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aa...@apache.org on 2022/04/06 05:34:31 UTC
[hadoop] branch trunk updated: HDFS-16527. Add global timeout rule for TestRouterDistCpProcedure (#4129)
This is an automated email from the ASF dual-hosted git repository.
aajisaka pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/hadoop.git
The following commit(s) were added to refs/heads/trunk by this push:
new 966b773a7c9 HDFS-16527. Add global timeout rule for TestRouterDistCpProcedure (#4129)
966b773a7c9 is described below
commit 966b773a7c9e15e6be3ceaf703b210128fc2e307
Author: litao <to...@gmail.com>
AuthorDate: Wed Apr 6 13:34:24 2022 +0800
HDFS-16527. Add global timeout rule for TestRouterDistCpProcedure (#4129)
Reviewed-by: Inigo Goiri <in...@apache.org>
Reviewed-by: Ayush Saxena <ay...@apache.org>
Signed-off-by: Akira Ajisaka <aa...@apache.org>
---
.../tools/fedbalance/TestDistCpProcedure.java | 24 ++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/hadoop-tools/hadoop-federation-balance/src/test/java/org/apache/hadoop/tools/fedbalance/TestDistCpProcedure.java b/hadoop-tools/hadoop-federation-balance/src/test/java/org/apache/hadoop/tools/fedbalance/TestDistCpProcedure.java
index 0bed3599036..39986d865ae 100644
--- a/hadoop-tools/hadoop-federation-balance/src/test/java/org/apache/hadoop/tools/fedbalance/TestDistCpProcedure.java
+++ b/hadoop-tools/hadoop-federation-balance/src/test/java/org/apache/hadoop/tools/fedbalance/TestDistCpProcedure.java
@@ -33,7 +33,9 @@ import org.apache.hadoop.tools.fedbalance.procedure.BalanceProcedure.RetryExcept
import org.apache.hadoop.tools.fedbalance.procedure.BalanceProcedureScheduler;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.rules.Timeout;
import java.io.IOException;
import java.io.OutputStream;
@@ -44,6 +46,7 @@ import java.io.DataInputStream;
import java.io.ByteArrayInputStream;
import java.net.URI;
import java.util.Random;
+import java.util.concurrent.TimeUnit;
import static junit.framework.TestCase.assertTrue;
import static org.apache.hadoop.tools.fedbalance.FedBalanceConfigs.SCHEDULER_JOURNAL_URI;
@@ -74,6 +77,11 @@ public class TestDistCpProcedure {
new FileEntry(SRCDAT + "/b/c", false)};
private static String nnUri;
+ @Rule
+ // There are multiple unit tests with different timeouts that fail multiple times because of
+ // DataStreamer#waitAndQueuePacket, so we set a larger global timeout.
+ public Timeout globalTimeout = new Timeout(180000, TimeUnit.MILLISECONDS);
+
@BeforeClass
public static void beforeClass() throws IOException {
DistCpProcedure.enableForTest();
@@ -98,7 +106,7 @@ public class TestDistCpProcedure {
}
}
- @Test(timeout = 90000)
+ @Test
public void testSuccessfulDistCpProcedure() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
@@ -140,7 +148,7 @@ public class TestDistCpProcedure {
cleanup(fs, new Path(testRoot));
}
- @Test(timeout = 30000)
+ @Test
public void testInitDistCp() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
@@ -198,7 +206,7 @@ public class TestDistCpProcedure {
cleanup(fs, new Path(testRoot));
}
- @Test(timeout = 30000)
+ @Test
public void testDiffDistCp() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
@@ -235,7 +243,7 @@ public class TestDistCpProcedure {
cleanup(fs, new Path(testRoot));
}
- @Test(timeout = 30000)
+ @Test
public void testStageFinalDistCp() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
@@ -260,7 +268,7 @@ public class TestDistCpProcedure {
cleanup(fs, new Path(testRoot));
}
- @Test(timeout = 30000)
+ @Test
public void testStageFinish() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
@@ -293,7 +301,7 @@ public class TestDistCpProcedure {
cleanup(fs, new Path(testRoot));
}
- @Test(timeout = 30000)
+ @Test
public void testRecoveryByStage() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
@@ -334,7 +342,7 @@ public class TestDistCpProcedure {
cleanup(fs, new Path(testRoot));
}
- @Test(timeout = 30000)
+ @Test
public void testShutdown() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
@@ -359,7 +367,7 @@ public class TestDistCpProcedure {
cleanup(fs, new Path(testRoot));
}
- @Test(timeout = 30000)
+ @Test
public void testDisableWrite() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org