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.
This commit is contained in:
Mukund Thakur 2020-10-13 17:57:55 +05:30 committed by GitHub
parent be3edd0532
commit 3e1b1dfd77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,6 +55,7 @@
import java.util.EnumSet; import java.util.EnumSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Random; import java.util.Random;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
@ -404,7 +405,7 @@ public Void run() throws IOException, URISyntaxException {
try { try {
it.next(); it.next();
fail("Iterator should error if out of elements."); fail("Iterator should error if out of elements.");
} catch (IllegalStateException e) { } catch (NoSuchElementException e) {
// pass // pass
} }
return null; return null;