HADOOP-16757. Increase timeout unit test rule for MetadataStoreTestBase (#1757)

Contributed by Mingliang Liu.

Signed-off-by: Steve Loughran <stevel@apache.org>
This commit is contained in:
Mingliang Liu 2019-12-13 08:19:27 -08:00 committed by GitHub
parent 65c4660bcd
commit d12ad9e8ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -61,7 +61,7 @@ public abstract class HadoopTestBase extends Assert {
* property is not defined.
* @return the recommended timeout for tests
*/
public static Timeout retrieveTestTimeout() {
protected Timeout retrieveTestTimeout() {
String propval = System.getProperty(PROPERTY_TEST_DEFAULT_TIMEOUT,
Integer.toString(
TEST_DEFAULT_TIMEOUT_VALUE));

View File

@ -31,6 +31,7 @@
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.junit.rules.Timeout;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -40,6 +41,7 @@
import org.apache.hadoop.fs.RemoteIterator;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.fs.s3a.S3AFileStatus;
import org.apache.hadoop.fs.s3a.S3ATestConstants;
import org.apache.hadoop.fs.s3a.S3ATestUtils;
import org.apache.hadoop.fs.s3a.Tristate;
import org.apache.hadoop.io.IOUtils;
@ -1309,4 +1311,10 @@ public static PathMetadata tombstone(Path path, long time) {
null, null);
return new PathMetadata(s3aStatus, Tristate.UNKNOWN, true);
}
@Override
protected Timeout retrieveTestTimeout() {
return Timeout.millis(S3ATestConstants.S3A_TEST_TIMEOUT);
}
}