HADOOP-18385. ITestS3ACannedACLs failure; fixed by adding in a span (#4736)

Contributed by Ashutosh Gupta
This commit is contained in:
Ashutosh Gupta 2022-08-18 13:57:43 +01:00 committed by GitHub
parent 682931a6ac
commit d09dd4a0b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -35,6 +35,7 @@
import org.apache.hadoop.fs.contract.ContractTestUtils; import org.apache.hadoop.fs.contract.ContractTestUtils;
import org.apache.hadoop.fs.s3a.audit.S3AAuditConstants; import org.apache.hadoop.fs.s3a.audit.S3AAuditConstants;
import org.apache.hadoop.fs.s3a.impl.StoreContext; import org.apache.hadoop.fs.s3a.impl.StoreContext;
import org.apache.hadoop.fs.store.audit.AuditSpan;
import static org.apache.hadoop.fs.s3a.Constants.CANNED_ACL; import static org.apache.hadoop.fs.s3a.Constants.CANNED_ACL;
import static org.apache.hadoop.fs.s3a.S3ATestUtils.removeBaseAndBucketOverrides; import static org.apache.hadoop.fs.s3a.S3ATestUtils.removeBaseAndBucketOverrides;
@ -64,6 +65,7 @@ protected Configuration createConfiguration() {
@Test @Test
public void testCreatedObjectsHaveACLs() throws Throwable { public void testCreatedObjectsHaveACLs() throws Throwable {
S3AFileSystem fs = getFileSystem(); S3AFileSystem fs = getFileSystem();
try (AuditSpan span = span()) {
Path dir = methodPath(); Path dir = methodPath();
fs.mkdirs(dir); fs.mkdirs(dir);
assertObjectHasLoggingGrant(dir, false); assertObjectHasLoggingGrant(dir, false);
@ -74,6 +76,7 @@ public void testCreatedObjectsHaveACLs() throws Throwable {
fs.rename(path, path2); fs.rename(path, path2);
assertObjectHasLoggingGrant(path2, true); assertObjectHasLoggingGrant(path2, true);
} }
}
/** /**
* Assert that a given object granted the AWS logging service * Assert that a given object granted the AWS logging service