Skip to content

Commit aeeebc5

Browse files
HADOOP-16941. ITestS3GuardOutOfBandOperations.testListingDelete failing on versioned bucket (#1919)
Contributed by Steve Loughran. Removed the failing probe and replacing with two probes which will fail on both versioned and unversioned buckets.
1 parent c791b0e commit aeeebc5

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/ITestS3GuardOutOfBandOperations.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
import static org.apache.hadoop.test.LambdaTestUtils.eventually;
7777
import static org.apache.hadoop.test.LambdaTestUtils.intercept;
7878

79+
import static org.apache.hadoop.test.LambdaTestUtils.interceptFuture;
7980
import static org.junit.Assume.assumeTrue;
8081
import static org.mockito.Mockito.mock;
8182
import static org.mockito.Mockito.when;
@@ -964,6 +965,14 @@ public void testListingDelete() throws Exception {
964965
// Delete the file without S3Guard (raw)
965966
deleteFile(rawFS, testFilePath);
966967

968+
// now, versioned FS or not, it will not be readable from the
969+
// raw FS, and this will fail in both open APIs during the open
970+
// phase, rather than when a read is attempted.
971+
interceptFuture(FileNotFoundException.class, "",
972+
rawFS.openFile(testFilePath).build());
973+
intercept(FileNotFoundException.class, () ->
974+
rawFS.open(testFilePath).close());
975+
967976
// File status will be still readable from s3guard
968977
S3AFileStatus status = (S3AFileStatus)
969978
guardedFs.getFileStatus(testFilePath);
@@ -985,8 +994,6 @@ public void testListingDelete() throws Exception {
985994
Assertions.assertThat(toChar(bytes))
986995
.describedAs("open(%s)", testFilePath)
987996
.isEqualTo(text);
988-
expectExceptionWhenReadingOpenFileAPI(rawFS, testFilePath, text,
989-
null);
990997
} else {
991998
// unversioned sequence
992999
expectExceptionWhenReading(testFilePath, text);

0 commit comments

Comments
 (0)