Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HADOOP-16941. ITestS3GuardOutOfBandOperations.testListingDelete failing on versioned bucket #1919

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import static org.apache.hadoop.test.LambdaTestUtils.eventually;
import static org.apache.hadoop.test.LambdaTestUtils.intercept;

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

// now, versioned FS or not, it will not be readable from the
// raw FS, and this will fail in both open APIs during the open
// phase, rather than when a read is attempted.
interceptFuture(FileNotFoundException.class, "",
rawFS.openFile(testFilePath).build());
intercept(FileNotFoundException.class, () ->
rawFS.open(testFilePath).close());

// File status will be still readable from s3guard
S3AFileStatus status = (S3AFileStatus)
guardedFs.getFileStatus(testFilePath);
Expand All @@ -985,8 +994,6 @@ public void testListingDelete() throws Exception {
Assertions.assertThat(toChar(bytes))
.describedAs("open(%s)", testFilePath)
.isEqualTo(text);
expectExceptionWhenReadingOpenFileAPI(rawFS, testFilePath, text,
null);
} else {
// unversioned sequence
expectExceptionWhenReading(testFilePath, text);
Expand Down