Skip to content

Commit d12ad9e

Browse files
authored
HADOOP-16757. Increase timeout unit test rule for MetadataStoreTestBase (#1757)
Contributed by Mingliang Liu. Signed-off-by: Steve Loughran <[email protected]>
1 parent 65c4660 commit d12ad9e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/test/HadoopTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public abstract class HadoopTestBase extends Assert {
6161
* property is not defined.
6262
* @return the recommended timeout for tests
6363
*/
64-
public static Timeout retrieveTestTimeout() {
64+
protected Timeout retrieveTestTimeout() {
6565
String propval = System.getProperty(PROPERTY_TEST_DEFAULT_TIMEOUT,
6666
Integer.toString(
6767
TEST_DEFAULT_TIMEOUT_VALUE));

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/s3guard/MetadataStoreTestBase.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.junit.Assume;
3232
import org.junit.Before;
3333
import org.junit.Test;
34+
import org.junit.rules.Timeout;
3435
import org.slf4j.Logger;
3536
import org.slf4j.LoggerFactory;
3637

@@ -40,6 +41,7 @@
4041
import org.apache.hadoop.fs.RemoteIterator;
4142
import org.apache.hadoop.fs.permission.FsPermission;
4243
import org.apache.hadoop.fs.s3a.S3AFileStatus;
44+
import org.apache.hadoop.fs.s3a.S3ATestConstants;
4345
import org.apache.hadoop.fs.s3a.S3ATestUtils;
4446
import org.apache.hadoop.fs.s3a.Tristate;
4547
import org.apache.hadoop.io.IOUtils;
@@ -1309,4 +1311,10 @@ public static PathMetadata tombstone(Path path, long time) {
13091311
null, null);
13101312
return new PathMetadata(s3aStatus, Tristate.UNKNOWN, true);
13111313
}
1314+
1315+
@Override
1316+
protected Timeout retrieveTestTimeout() {
1317+
return Timeout.millis(S3ATestConstants.S3A_TEST_TIMEOUT);
1318+
}
1319+
13121320
}

0 commit comments

Comments
 (0)