Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
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;
Expand All @@ -44,6 +46,7 @@
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;
Expand Down Expand Up @@ -74,6 +77,9 @@ public class TestDistCpProcedure {
new FileEntry(SRCDAT + "/b/c", false)};
private static String nnUri;

@Rule
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a comment justifying the long timeout.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @goiri for your review. I added a comment for this.

public Timeout globalTimeout = new Timeout(180000, TimeUnit.MILLISECONDS);

@BeforeClass
public static void beforeClass() throws IOException {
DistCpProcedure.enableForTest();
Expand All @@ -98,7 +104,7 @@ public static void afterClass() {
}
}

@Test(timeout = 90000)
@Test
public void testSuccessfulDistCpProcedure() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
Expand Down Expand Up @@ -140,7 +146,7 @@ public void testSuccessfulDistCpProcedure() throws Exception {
cleanup(fs, new Path(testRoot));
}

@Test(timeout = 30000)
@Test
public void testInitDistCp() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
Expand Down Expand Up @@ -198,7 +204,7 @@ public void testDiffThreshold() throws Exception {
cleanup(fs, new Path(testRoot));
}

@Test(timeout = 30000)
@Test
public void testDiffDistCp() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
Expand Down Expand Up @@ -235,7 +241,7 @@ public void testDiffDistCp() throws Exception {
cleanup(fs, new Path(testRoot));
}

@Test(timeout = 30000)
@Test
public void testStageFinalDistCp() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
Expand All @@ -260,7 +266,7 @@ public void testStageFinalDistCp() throws Exception {
cleanup(fs, new Path(testRoot));
}

@Test(timeout = 30000)
@Test
public void testStageFinish() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
Expand Down Expand Up @@ -293,7 +299,7 @@ public void testStageFinish() throws Exception {
cleanup(fs, new Path(testRoot));
}

@Test(timeout = 30000)
@Test
public void testRecoveryByStage() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
Expand Down Expand Up @@ -334,7 +340,7 @@ public void testRecoveryByStage() throws Exception {
cleanup(fs, new Path(testRoot));
}

@Test(timeout = 30000)
@Test
public void testShutdown() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
Expand All @@ -359,7 +365,7 @@ public void testShutdown() throws Exception {
cleanup(fs, new Path(testRoot));
}

@Test(timeout = 30000)
@Test
public void testDisableWrite() throws Exception {
String testRoot = nnUri + "/user/foo/testdir." + getMethodName();
DistributedFileSystem fs =
Expand Down