This is an automated email from the ASF dual-hosted git repository.
sodonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new ee19b95 HDDS-5748. Reuse mini-clusters in
TestOzoneFSWithObjectStoreCreate (#2646)
ee19b95 is described below
commit ee19b95ff0e4260c4fd64bd58a7702facff408ec
Author: Stephen O'Donnell <[email protected]>
AuthorDate: Wed Sep 15 15:02:41 2021 +0100
HDDS-5748. Reuse mini-clusters in TestOzoneFSWithObjectStoreCreate (#2646)
---
.../fs/ozone/TestOzoneFSWithObjectStoreCreate.java | 30 ++++++++++++++--------
1 file changed, 20 insertions(+), 10 deletions(-)
diff --git
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java
index 9582a17..2a97f3d 100644
---
a/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java
+++
b/hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFSWithObjectStoreCreate.java
@@ -37,9 +37,11 @@ import org.apache.hadoop.ozone.client.io.OzoneOutputStream;
import org.apache.hadoop.ozone.om.OMConfigKeys;
import org.apache.hadoop.ozone.om.exceptions.OMException;
import org.apache.hadoop.ozone.om.helpers.OmMultipartInfo;
+import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.After;
import org.junit.Before;
+import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.Timeout;
@@ -70,7 +72,7 @@ public class TestOzoneFSWithObjectStoreCreate {
private String rootPath;
- private MiniOzoneCluster cluster = null;
+ private static MiniOzoneCluster cluster = null;
private OzoneFileSystem o3fs;
@@ -78,12 +80,8 @@ public class TestOzoneFSWithObjectStoreCreate {
private String bucketName;
-
- @Before
- public void init() throws Exception {
- volumeName = RandomStringUtils.randomAlphabetic(10).toLowerCase();
- bucketName = RandomStringUtils.randomAlphabetic(10).toLowerCase();
-
+ @BeforeClass
+ public static void initClass() throws Exception {
OzoneConfiguration conf = new OzoneConfiguration();
conf.setBoolean(OMConfigKeys.OZONE_OM_ENABLE_FILESYSTEM_PATHS, true);
@@ -91,6 +89,21 @@ public class TestOzoneFSWithObjectStoreCreate {
.setNumDatanodes(3)
.build();
cluster.waitForClusterToBeReady();
+ }
+
+ @AfterClass
+ public static void teardownClass() {
+ if (cluster != null) {
+ cluster.shutdown();
+ }
+ }
+
+ @Before
+ public void init() throws Exception {
+ volumeName = RandomStringUtils.randomAlphabetic(10).toLowerCase();
+ bucketName = RandomStringUtils.randomAlphabetic(10).toLowerCase();
+
+ OzoneConfiguration conf = cluster.getConf();
// create a volume and a bucket to be used by OzoneFileSystem
TestDataUtil.createVolumeAndBucket(cluster, volumeName, bucketName);
@@ -102,9 +115,6 @@ public class TestOzoneFSWithObjectStoreCreate {
@After
public void teardown() {
- if (cluster != null) {
- cluster.shutdown();
- }
IOUtils.closeQuietly(o3fs);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]