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-19351. S3A: Add config option to skip test with performance mode #7223

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ understands the risks.
* If an option is to be tuned which may relax semantics, a new option MUST be defined.
* Unknown flags are ignored; this is to avoid compatibility.
* The option `*` means "turn everything on". This is implicitly unstable across releases.
* Other stores may retain stricter semantics.

| *Option* | *Meaning* | Since |
|----------|--------------------|:------|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,10 @@ on third party stores.
<name>test.fs.s3a.create.create.acl.enabled</name>
<value>false</value>
</property>
<property>
<name>test.fs.s3a.perf.enabled</name>
<value>false</value>
</property>
```

See [Third Party Stores](third_party_stores.html) for more on this topic.
Expand Down Expand Up @@ -767,6 +771,18 @@ Tests in `ITestS3AContentEncoding` may need disabling
<value>false</value>
</property>
```

### Disabling tests running in performance mode

Some tests running in performance mode turn off the safety checks. They expect breaking posix semantics.
For stores with stricter semantics, these test cases must be disabled.
```xml
<property>
<name>test.fs.s3a.perf.enabled</name>
<value>false</value>
</property>
```

### Tests which may fail (and which you can ignore)

* `ITestS3AContractMultipartUploader` tests `testMultipartUploadAbort` and `testSingleUpload` raising `FileNotFoundException`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@
import org.apache.hadoop.fs.contract.AbstractFSContract;
import org.apache.hadoop.fs.s3a.S3ATestUtils;

import static org.apache.hadoop.fs.s3a.S3ATestConstants.KEY_PERFORMANCE_TESTS_ENABLED;
import static org.apache.hadoop.fs.s3a.Constants.CONNECTION_EXPECT_CONTINUE;
import static org.apache.hadoop.fs.s3a.S3ATestUtils.removeBaseAndBucketOverrides;
import static org.apache.hadoop.fs.s3a.S3ATestUtils.setPerformanceFlags;
import static org.apache.hadoop.fs.s3a.S3ATestUtils.skipIfNotEnabled;

/**
* S3A contract tests creating files.
Expand Down Expand Up @@ -84,6 +86,9 @@ protected Configuration createConfiguration() {
conf,
CONNECTION_EXPECT_CONTINUE);
conf.setBoolean(CONNECTION_EXPECT_CONTINUE, expectContinue);
if (createPerformance) {
skipIfNotEnabled(conf, KEY_PERFORMANCE_TESTS_ENABLED, "Skipping tests running in performance mode");
}
S3ATestUtils.disableFilesystemCaching(conf);
return conf;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@

import static org.apache.hadoop.fs.contract.ContractTestUtils.createFile;
import static org.apache.hadoop.fs.contract.ContractTestUtils.dataset;
import static org.apache.hadoop.fs.s3a.S3ATestConstants.KEY_PERFORMANCE_TESTS_ENABLED;
import static org.apache.hadoop.fs.s3a.S3ATestUtils.setPerformanceFlags;
import static org.apache.hadoop.fs.s3a.S3ATestUtils.skipIfNotEnabled;

/**
* Test mkdir operations on S3A with create performance mode.
Expand All @@ -50,6 +52,8 @@ protected AbstractFSContract createContract(Configuration conf) {

@Test
public void testMkdirOverParentFile() throws Throwable {
skipIfNotEnabled(getContract().getConf(), KEY_PERFORMANCE_TESTS_ENABLED,
"Skipping tests running in performance mode");
describe("try to mkdir where a parent is a file, should pass");
FileSystem fs = getFileSystem();
Path path = methodPath();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public interface S3ATestConstants {
*/
String KEY_ACL_TESTS_ENABLED = TEST_FS_S3A + "create.acl.enabled";

/**
* A property set to true if tests running in performance mode are enabled: {@value }
*/
String KEY_PERFORMANCE_TESTS_ENABLED = TEST_FS_S3A + "perf.enabled";

/**
* A property set to true if V1 tests are enabled: {@value}.
*/
Expand Down
Loading