Skip to content

Commit 9fea0cb

Browse files
committed
HADOOP-19610 huge and contract test failures
If you override a test method from a superclass you need to declare it as @test again; the tag is no longer @inherited as it was in Junit4 * Huge tests visibily failed as they were incomplete * Contract tests were failing to run some tests cases
1 parent d0753c9 commit 9fea0cb

File tree

8 files changed

+47
-1
lines changed

8 files changed

+47
-1
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public void testPageSizeWhenMultiObjectsDisabled() throws Exception {
149149
}
150150

151151
@Override
152+
@Test
152153
public void testDeletePathsDirectory() throws Exception {
153154
List<Path> paths = new ArrayList<>();
154155
Path dirPath = new Path(basePath, "dir");
@@ -180,6 +181,7 @@ public void testBulkDeleteParentDirectoryWithDirectories() throws Exception {
180181
assertIsDirectory(subDir);
181182
}
182183

184+
@Test
183185
public void testBulkDeleteParentDirectoryWithFiles() throws Exception {
184186
List<Path> paths = new ArrayList<>();
185187
Path dirPath = new Path(basePath, "dir");

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818

1919
package org.apache.hadoop.fs.contract.s3a;
2020

21+
import org.junit.jupiter.api.Test;
22+
2123
import static org.apache.hadoop.fs.s3a.Constants.*;
2224
import static org.apache.hadoop.fs.s3a.S3ATestConstants.SCALE_TEST_TIMEOUT_MILLIS;
2325
import static org.apache.hadoop.fs.s3a.S3ATestUtils.skipIfAnalyticsAcceleratorEnabled;
@@ -62,6 +64,7 @@ protected S3AContract createContract(Configuration conf) {
6264
return new S3AContract(conf);
6365
}
6466

67+
@Test
6568
@Override
6669
public void testDistCpWithIterator() throws Exception {
6770
final long renames = getRenameOperationCount();
@@ -70,6 +73,7 @@ public void testDistCpWithIterator() throws Exception {
7073
renames, "Expected no renames for a direct write distcp");
7174
}
7275

76+
@Test
7377
@Override
7478
public void testNonDirectWrite() throws Exception {
7579
final long renames = getRenameOperationCount();
@@ -78,6 +82,7 @@ public void testNonDirectWrite() throws Exception {
7882
"Expected 2 renames for a non-direct write distcp");
7983
}
8084

85+
@Test
8186
@Override
8287
public void testDistCpUpdateCheckFileSkip() throws Exception {
8388
// Currently analytics accelerator does not support reading of files that have been overwritten.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.apache.hadoop.test.tags.ScaleTest;
2626

2727
import org.junit.jupiter.api.BeforeEach;
28+
import org.junit.jupiter.api.Test;
2829

2930
import static org.apache.hadoop.fs.contract.ContractTestUtils.skip;
3031
import static org.apache.hadoop.fs.s3a.S3ATestConstants.DEFAULT_SCALE_TESTS_ENABLED;
@@ -115,21 +116,26 @@ public void setup() throws Exception {
115116
/**
116117
* S3 has no concept of directories, so this test does not apply.
117118
*/
119+
@Test
120+
@Override
118121
public void testDirectoryInTheWay() throws Exception {
119122
skip("Unsupported");
120123
}
121124

125+
@Test
122126
@Override
123127
public void testMultipartUploadReverseOrder() throws Exception {
124128
skip("skipped for speed");
125129
}
126130

131+
@Test
127132
@Override
128133
public void testMultipartUploadReverseOrderNonContiguousPartNumbers() throws Exception {
129134
assumeNotS3ExpressFileSystem(getFileSystem());
130135
super.testMultipartUploadReverseOrderNonContiguousPartNumbers();
131136
}
132137

138+
@Test
133139
@Override
134140
public void testConcurrentUploads() throws Throwable {
135141
assumeNotS3ExpressFileSystem(getFileSystem());

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ protected AbstractFSContract createContract(Configuration conf) {
5555
return new S3AContract(conf);
5656
}
5757

58+
@Test
5859
@Override
5960
public void testRenameDirIntoExistingDir() throws Throwable {
6061
describe("S3A rename into an existing directory returns false");

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import org.apache.hadoop.fs.s3a.auth.delegation.DelegationTokenProvider;
5656
import org.apache.hadoop.security.UserGroupInformation;
5757

58+
import static org.apache.hadoop.fs.s3a.Constants.CHECKSUM_ALGORITHM;
5859
import static org.apache.hadoop.fs.s3a.Constants.CUSTOM_SIGNERS;
5960
import static org.apache.hadoop.fs.s3a.Constants.ENABLE_MULTI_DELETE;
6061
import static org.apache.hadoop.fs.s3a.Constants.SIGNING_ALGORITHM_S3;
@@ -103,6 +104,14 @@ public ITestCustomSigner(
103104
this.bulkDelete = bulkDelete;
104105
}
105106

107+
@Override
108+
protected Configuration createConfiguration() {
109+
final Configuration conf = super.createConfiguration();
110+
// customer signer doesn't work
111+
removeBaseAndBucketOverrides(conf, CHECKSUM_ALGORITHM);
112+
return conf;
113+
}
114+
106115
@Override
107116
@BeforeEach
108117
public void setup() throws Exception {
@@ -224,7 +233,7 @@ private Configuration createTestConfig(String identifier) {
224233
// Having the checksum algorithm in this test causes
225234
// x-amz-sdk-checksum-algorithm specified, but no corresponding
226235
// x-amz-checksum-* or x-amz-trailer headers were found
227-
conf.unset(Constants.CHECKSUM_ALGORITHM);
236+
conf.unset(CHECKSUM_ALGORITHM);
228237

229238
// make absolutely sure there is no caching.
230239
disableFilesystemCaching(conf);

hadoop-tools/hadoop-aws/src/test/java/org/apache/hadoop/fs/s3a/commit/magic/ITestS3AHugeMagicCommits.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424

2525
import org.assertj.core.api.Assertions;
2626
import org.junit.jupiter.api.BeforeEach;
27+
import org.junit.jupiter.api.MethodOrderer;
2728
import org.junit.jupiter.api.Test;
29+
import org.junit.jupiter.api.TestMethodOrder;
2830
import org.slf4j.Logger;
2931
import org.slf4j.LoggerFactory;
3032

@@ -42,6 +44,7 @@
4244
import org.apache.hadoop.fs.s3a.commit.impl.CommitOperations;
4345
import org.apache.hadoop.fs.s3a.scale.AbstractSTestS3AHugeFiles;
4446
import org.apache.hadoop.fs.store.audit.AuditSpan;
47+
import org.apache.hadoop.test.tags.ScaleTest;
4548

4649
import static org.apache.hadoop.fs.s3a.MultipartTestUtils.listMultipartUploads;
4750
import static org.apache.hadoop.fs.s3a.Statistic.MULTIPART_UPLOAD_ABORT_UNDER_PATH_INVOKED;
@@ -57,6 +60,8 @@
5760
*
5861
* This is a scale test.
5962
*/
63+
@ScaleTest
64+
@TestMethodOrder(MethodOrderer.Alphanumeric.class)
6065
public class ITestS3AHugeMagicCommits extends AbstractSTestS3AHugeFiles {
6166
private static final Logger LOG = LoggerFactory.getLogger(
6267
ITestS3AHugeMagicCommits.class);
@@ -136,6 +141,7 @@ public void test_000_CleanupPendingUploads() throws IOException {
136141
LOG.info("Aborted {} uploads under {}", count, key);
137142
}
138143

144+
@Test
139145
@Override
140146
public void test_030_postCreationAssertions() throws Throwable {
141147
describe("Committing file");
@@ -191,21 +197,25 @@ private void skipQuietly(String text) {
191197
describe("Skipping: %s", text);
192198
}
193199

200+
@Test
194201
@Override
195202
public void test_040_PositionedReadHugeFile() {
196203
skipQuietly("test_040_PositionedReadHugeFile");
197204
}
198205

206+
@Test
199207
@Override
200208
public void test_050_readHugeFile() {
201209
skipQuietly("readHugeFile");
202210
}
203211

212+
@Test
204213
@Override
205214
public void test_100_renameHugeFile() {
206215
skipQuietly("renameHugeFile");
207216
}
208217

218+
@Test
209219
@Override
210220
public void test_800_DeleteHugeFiles() throws IOException {
211221
if (getFileSystem() != null) {

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.apache.hadoop.fs.s3a.scale;
2020

2121
import org.assertj.core.api.Assertions;
22+
import org.junit.jupiter.api.Test;
2223

2324
import org.apache.hadoop.conf.Configuration;
2425
import org.apache.hadoop.fs.s3a.Constants;
@@ -100,6 +101,7 @@ protected Configuration createScaleConfiguration() {
100101
/**
101102
* Verify multipart copy is disabled.
102103
*/
104+
@Test
103105
@Override
104106
public void test_030_postCreationAssertions() throws Throwable {
105107
super.test_030_postCreationAssertions();

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020

2121
import java.io.IOException;
2222

23+
import org.junit.jupiter.api.MethodOrderer;
24+
import org.junit.jupiter.api.Test;
25+
import org.junit.jupiter.api.TestMethodOrder;
2326
import org.slf4j.Logger;
2427
import org.slf4j.LoggerFactory;
2528

@@ -44,6 +47,7 @@
4447
* for creating and renaming huge files with multipart upload requests.
4548
*/
4649
@ScaleTest
50+
@TestMethodOrder(MethodOrderer.Alphanumeric.class)
4751
public class ITestS3AHugeFilesStorageClass extends AbstractSTestS3AHugeFiles {
4852

4953
private static final Logger LOG = LoggerFactory.getLogger(ITestS3AHugeFilesStorageClass.class);
@@ -64,33 +68,39 @@ protected String getBlockOutputBufferName() {
6468
return Constants.FAST_UPLOAD_BUFFER_ARRAY;
6569
}
6670

71+
@Test
6772
@Override
6873
public void test_010_CreateHugeFile() throws IOException {
6974
super.test_010_CreateHugeFile();
7075
assertStorageClass(getPathOfFileToCreate());
7176
}
7277

78+
@Test
7379
@Override
7480
public void test_030_postCreationAssertions() throws Throwable {
7581
super.test_030_postCreationAssertions();
7682
assertStorageClass(getPathOfFileToCreate());
7783
}
7884

7985
@Override
86+
@Test
8087
public void test_040_PositionedReadHugeFile() throws Throwable {
8188
skipQuietly("PositionedReadHugeFile");
8289
}
8390

91+
@Test
8492
@Override
8593
public void test_050_readHugeFile() throws Throwable {
8694
skipQuietly("readHugeFile");
8795
}
8896

97+
@Test
8998
@Override
9099
public void test_090_verifyRenameSourceEncryption() throws IOException {
91100
skipQuietly("verifyRenameSourceEncryption");
92101
}
93102

103+
@Test
94104
@Override
95105
public void test_100_renameHugeFile() throws Throwable {
96106
Path hugefile = getHugefile();
@@ -112,6 +122,7 @@ public void test_100_renameHugeFile() throws Throwable {
112122
assertStorageClass(hugefileRenamed);
113123
}
114124

125+
@Test
115126
@Override
116127
public void test_110_verifyRenameDestEncryption() throws IOException {
117128
skipQuietly("verifyRenameDestEncryption");

0 commit comments

Comments
 (0)