76
76
import static org .apache .hadoop .test .LambdaTestUtils .eventually ;
77
77
import static org .apache .hadoop .test .LambdaTestUtils .intercept ;
78
78
79
+ import static org .apache .hadoop .test .LambdaTestUtils .interceptFuture ;
79
80
import static org .junit .Assume .assumeTrue ;
80
81
import static org .mockito .Mockito .mock ;
81
82
import static org .mockito .Mockito .when ;
@@ -964,6 +965,14 @@ public void testListingDelete() throws Exception {
964
965
// Delete the file without S3Guard (raw)
965
966
deleteFile (rawFS , testFilePath );
966
967
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
+
967
976
// File status will be still readable from s3guard
968
977
S3AFileStatus status = (S3AFileStatus )
969
978
guardedFs .getFileStatus (testFilePath );
@@ -985,8 +994,6 @@ public void testListingDelete() throws Exception {
985
994
Assertions .assertThat (toChar (bytes ))
986
995
.describedAs ("open(%s)" , testFilePath )
987
996
.isEqualTo (text );
988
- expectExceptionWhenReadingOpenFileAPI (rawFS , testFilePath , text ,
989
- null );
990
997
} else {
991
998
// unversioned sequence
992
999
expectExceptionWhenReading (testFilePath , text );
0 commit comments