From c392d9022a37179cde30d1606fbf5cca4dd3fb92 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Fri, 28 Aug 2020 15:39:09 +0100 Subject: [PATCH] HDFS-15471. TestHDFSContractMultipartUploader failing (#2252) Contributed by Steve Loughran (Was: broken by Steve Loughran) --- .../AbstractContractMultipartUploaderTest.java | 17 +++++++++++------ .../hdfs/TestHDFSContractMultipartUploader.java | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractMultipartUploaderTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractMultipartUploaderTest.java index 31926964c8..8a520fae8a 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractMultipartUploaderTest.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractMultipartUploaderTest.java @@ -807,12 +807,17 @@ public void testConcurrentUploads() throws Throwable { // now upload part 2. complete(file, upload2, partHandles2); - // and await the visible length to match - eventually(timeToBecomeConsistentMillis(), - () -> verifyFileLength(file, size2), - new LambdaTestUtils.ProportionalRetryInterval( - CONSISTENCY_INTERVAL, - timeToBecomeConsistentMillis())); + + // and await the visible length to match, if this FS is not + // consistent. + final int consistencyDelay = timeToBecomeConsistentMillis(); + if (consistencyDelay > 0) { + eventually(consistencyDelay, + () -> verifyFileLength(file, size2), + new LambdaTestUtils.ProportionalRetryInterval( + CONSISTENCY_INTERVAL, + consistencyDelay)); + } verifyContents(file, digest2, size2); } diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/contract/hdfs/TestHDFSContractMultipartUploader.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/contract/hdfs/TestHDFSContractMultipartUploader.java index 54f4ed2737..0efb33f5db 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/contract/hdfs/TestHDFSContractMultipartUploader.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/fs/contract/hdfs/TestHDFSContractMultipartUploader.java @@ -35,7 +35,7 @@ public class TestHDFSContractMultipartUploader extends AbstractContractMultipartUploaderTest { protected static final Logger LOG = - LoggerFactory.getLogger(AbstractContractMultipartUploaderTest.class); + LoggerFactory.getLogger(TestHDFSContractMultipartUploader.class); @BeforeClass public static void createCluster() throws IOException {