From bb398f78cc38a32533d5bbba034765376c99c507 Mon Sep 17 00:00:00 2001 From: daimin Date: Wed, 11 May 2022 07:56:53 +0800 Subject: [PATCH] Fix TestDFSStripedInputStreamWithRandomECPolicy (#4296) --- .../org/apache/hadoop/hdfs/TestDFSStripedInputStream.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSStripedInputStream.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSStripedInputStream.java index 12cfd49a0bd..2369d42482a 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSStripedInputStream.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSStripedInputStream.java @@ -669,7 +669,12 @@ public void testUnbuffer() throws Exception { @Test public void testBlockReader() throws Exception { - ecPolicy = StripedFileTestUtil.getDefaultECPolicy(); // RS-6-3-1024k + ErasureCodingPolicy targetPolicy = StripedFileTestUtil.getDefaultECPolicy(); // RS-6-3-1024k + if (!ecPolicy.equals(targetPolicy)) { + // Be sure not affected by random EC policy from + // TestDFSStripedInputStreamWithRandomECPolicy. + return; + } int fileSize = 19 * cellSize + 100; long stripeSize = (long) dataBlocks * cellSize; byte[] bytes = StripedFileTestUtil.generateBytes(fileSize);