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 Steve Loughran
parent e8a28dc0d7
commit a5d5d0708a
No known key found for this signature in database
GPG Key ID: D22CF846DBB162A0
1 changed files with 12 additions and 9 deletions

View File

@ -35,6 +35,7 @@ import org.apache.hadoop.fs.Path;
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,15 +65,17 @@ public class ITestS3ACannedACLs extends AbstractS3ATestBase {
@Test @Test
public void testCreatedObjectsHaveACLs() throws Throwable { public void testCreatedObjectsHaveACLs() throws Throwable {
S3AFileSystem fs = getFileSystem(); S3AFileSystem fs = getFileSystem();
Path dir = methodPath(); try (AuditSpan span = span()) {
fs.mkdirs(dir); Path dir = methodPath();
assertObjectHasLoggingGrant(dir, false); fs.mkdirs(dir);
Path path = new Path(dir, "1"); assertObjectHasLoggingGrant(dir, false);
ContractTestUtils.touch(fs, path); Path path = new Path(dir, "1");
assertObjectHasLoggingGrant(path, true); ContractTestUtils.touch(fs, path);
Path path2 = new Path(dir, "2"); assertObjectHasLoggingGrant(path, true);
fs.rename(path, path2); Path path2 = new Path(dir, "2");
assertObjectHasLoggingGrant(path2, true); fs.rename(path, path2);
assertObjectHasLoggingGrant(path2, true);
}
} }
/** /**