HDFS-15626. 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.

Change-Id: I6cec41c20467920cf21f169653553535414b2680
This commit is contained in:
Mukund Thakur 2020-10-13 17:57:55 +05:30 committed by Steve Loughran
parent 2a043b987c
commit 351b1498d3
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
1 changed files with 2 additions and 1 deletions

View File

@ -52,6 +52,7 @@ import java.util.Collection;
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;
@ -399,7 +400,7 @@ public class TestWebHDFS {
try {
it.next();
fail("Iterator should error if out of elements.");
} catch (IllegalStateException e) {
} catch (NoSuchElementException e) {
// pass
}
return null;