From 3e1b1dfd7744e1eebb5bc09009f3fb77abe686db Mon Sep 17 00:00:00 2001 From: Mukund Thakur Date: Tue, 13 Oct 2020 17:57:55 +0530 Subject: [PATCH] HADOOP-17303. TestWebHDFS.testLargeDirectory failing (#2380) Fixes the regression caused by HADOOP-17281, where the WebHDFS client listStatusIterator (correctly) throws NoSuchElementException when next() runs out of values. Contributed by Mukund Thakur. --- .../src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java index 9e4f727cc3..a0308b90fb 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/web/TestWebHDFS.java @@ -55,6 +55,7 @@ import java.util.EnumSet; import java.util.Iterator; import java.util.Map; +import java.util.NoSuchElementException; import java.util.Random; import com.google.common.collect.ImmutableList; @@ -404,7 +405,7 @@ public Void run() throws IOException, URISyntaxException { try { it.next(); fail("Iterator should error if out of elements."); - } catch (IllegalStateException e) { + } catch (NoSuchElementException e) { // pass } return null;