ivanzlenko commented on code in PR #7870:
URL: https://github.com/apache/ozone/pull/7870#discussion_r1958358383
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/OzoneFileSystemTests.java:
##########
@@ -33,18 +35,31 @@
import static
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_FS_LISTING_PAGE_SIZE;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_REPLICATION;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_REPLICATION_TYPE;
+import static org.apache.hadoop.ozone.OzoneConsts.OZONE_OFS_URI_SCHEME;
+import static org.apache.hadoop.ozone.OzoneConsts.OZONE_URI_SCHEME;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Common test cases for Ozone file systems.
*/
-final class OzoneFileSystemTests {
+public final class OzoneFileSystemTests {
private OzoneFileSystemTests() {
// no instances
}
+ /**
+ * Set file system listing page size. Also disable the file system cache to
Review Comment:
```suggestion
* Set file system listing page size. Also disable the file system cache to
```
##########
hadoop-ozone/integration-test/src/test/java/org/apache/ozone/test/FreonTests.java:
##########
@@ -0,0 +1,104 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ozone.test;
+
+import org.apache.hadoop.hdds.conf.OzoneConfiguration;
+import org.apache.hadoop.hdds.conf.StorageUnit;
+import org.apache.hadoop.ozone.ClientConfigForTesting;
+import org.apache.hadoop.ozone.MiniOzoneCluster;
+import org.junit.jupiter.api.Nested;
+import org.junit.jupiter.api.TestInstance;
+
+/**
+ * Group tests that write more data than usual (e.g. Freon tests). These are
+ * separated from {@link NonHATests}, because they tend to take a bit longer.
+ * This keeps {@link NonHATests} leaner.
+ * <p/>
+ * Specific tests are implemented in separate classes, and they are subclasses
+ * here as {@link Nested} inner classes. This allows running all tests in the
+ * same cluster.
+ */
+@TestInstance(TestInstance.Lifecycle.PER_CLASS)
+public abstract class FreonTests extends ClusterForTests<MiniOzoneCluster> {
+
+ @Override
+ protected OzoneConfiguration createOzoneConfig() {
+ OzoneConfiguration conf = super.createOzoneConfig();
+ ClientConfigForTesting.newBuilder(StorageUnit.MB)
+ .setChunkSize(4)
+ .setBlockSize(256)
+ .applyTo(conf);
+ return conf;
+ }
+
+ @Nested
+ class DNRPCLoadGenerator extends
org.apache.hadoop.ozone.freon.TestDNRPCLoadGenerator {
Review Comment:
Please replace with qualified import.
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOmBucketReadWriteFileOps.java:
##########
@@ -16,176 +16,135 @@
*/
package org.apache.hadoop.ozone.freon;
-import org.apache.commons.io.FileUtils;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;
-import org.apache.hadoop.hdds.conf.OzoneConfiguration;
-import org.apache.hadoop.hdds.utils.IOUtils;
-import org.apache.hadoop.ozone.MiniOzoneCluster;
import org.apache.hadoop.ozone.OzoneConsts;
-import org.apache.hadoop.ozone.client.ObjectStore;
+import org.apache.hadoop.ozone.TestDataUtil;
+import org.apache.hadoop.ozone.client.BucketArgs;
import org.apache.hadoop.ozone.client.OzoneClient;
-import org.apache.hadoop.ozone.client.OzoneClientFactory;
-import org.apache.hadoop.ozone.client.OzoneVolume;
-import org.apache.hadoop.ozone.om.OMConfigKeys;
-import org.apache.hadoop.ozone.om.helpers.BucketLayout;
import org.apache.hadoop.ozone.om.lock.OMLockMetrics;
-import org.apache.ozone.test.GenericTestUtils;
-import org.apache.ratis.server.RaftServer;
-import org.apache.ratis.server.raftlog.RaftLog;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.io.TempDir;
+import org.apache.ozone.test.NonHATests;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.MethodSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import org.slf4j.event.Level;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
import java.net.URI;
+import java.util.Arrays;
+import java.util.List;
+import java.util.UUID;
+import static org.apache.hadoop.ozone.om.OMConfigKeys.OZONE_OM_ADDRESS_KEY;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Test for OmBucketReadWriteFileOps.
*/
-public class TestOmBucketReadWriteFileOps {
- @TempDir
- private java.nio.file.Path path;
- private OzoneConfiguration conf = null;
- private MiniOzoneCluster cluster = null;
- private ObjectStore store = null;
+public abstract class TestOmBucketReadWriteFileOps implements
NonHATests.TestCase {
private static final Logger LOG =
LoggerFactory.getLogger(TestOmBucketReadWriteFileOps.class);
- private OzoneClient client;
- @BeforeEach
- public void setup() {
- GenericTestUtils.setLogLevel(RaftLog.LOG, Level.DEBUG);
- GenericTestUtils.setLogLevel(RaftServer.LOG, Level.DEBUG);
+ static List<ParameterBuilder> parameters() {
+ return Arrays.asList(
+ new ParameterBuilder()
Review Comment:
Feels like it is worth move each individual builder into a separate method
with name reflecting a case it is covering. It will improve readability a lot.
And we even can add separate javadocs later.
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/OzoneFileSystemTests.java:
##########
@@ -33,18 +35,31 @@
import static
org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_FS_LISTING_PAGE_SIZE;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_REPLICATION;
import static org.apache.hadoop.ozone.OzoneConfigKeys.OZONE_REPLICATION_TYPE;
+import static org.apache.hadoop.ozone.OzoneConsts.OZONE_OFS_URI_SCHEME;
+import static org.apache.hadoop.ozone.OzoneConsts.OZONE_URI_SCHEME;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals;
/**
* Common test cases for Ozone file systems.
*/
-final class OzoneFileSystemTests {
+public final class OzoneFileSystemTests {
Review Comment:
Can you add TODO with Jira link?
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/freon/TestOmBucketReadWriteFileOps.java:
##########
@@ -243,82 +202,129 @@ private void verifyOMLockMetrics(OMLockMetrics
omLockMetrics) {
assertThat(writeHeldSamples).isPositive();
}
- private static class ParameterBuilder {
+ static class ParameterBuilder {
Review Comment:
Can you add TODO with Jira link?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]