From d486ae8c0ffeb5127c504ef45795c3c14e3f5b5c Mon Sep 17 00:00:00 2001 From: daimin Date: Tue, 10 May 2022 08:01:16 +0800 Subject: [PATCH] Fix TestDFSStripedInputStreamWithRandomECPolicy (#4291) --- .../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 class TestDFSStripedInputStream { @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);