|
@@ -67,7 +67,8 @@ import org.junit.rules.Timeout;
|
|
|
import org.mockito.Mockito;
|
|
|
import org.apache.hadoop.test.GenericTestUtils;
|
|
|
|
|
|
-import static org.apache.hadoop.hdds.HddsConfigKeys.HDDS_HEARTBEAT_INTERVAL;
|
|
|
+import static org.apache.hadoop.hdds
|
|
|
+ .HddsConfigKeys.HDDS_CONTAINER_REPORT_INTERVAL;
|
|
|
import static org.junit.Assert.fail;
|
|
|
|
|
|
/**
|
|
@@ -188,7 +189,8 @@ public class TestStorageContainerManager {
|
|
|
public void testBlockDeletionTransactions() throws Exception {
|
|
|
int numKeys = 5;
|
|
|
OzoneConfiguration conf = new OzoneConfiguration();
|
|
|
- conf.setTimeDuration(HDDS_HEARTBEAT_INTERVAL, 5, TimeUnit.SECONDS);
|
|
|
+ conf.setTimeDuration(HDDS_CONTAINER_REPORT_INTERVAL, 100,
|
|
|
+ TimeUnit.MILLISECONDS);
|
|
|
conf.setTimeDuration(ScmConfigKeys.OZONE_SCM_HEARTBEAT_PROCESS_INTERVAL,
|
|
|
3000,
|
|
|
TimeUnit.MILLISECONDS);
|
|
@@ -200,7 +202,9 @@ public class TestStorageContainerManager {
|
|
|
conf.setInt(ScmConfigKeys.OZONE_SCM_CONTAINER_PROVISION_BATCH_SIZE,
|
|
|
numKeys);
|
|
|
|
|
|
- MiniOzoneCluster cluster = MiniOzoneCluster.newBuilder(conf).build();
|
|
|
+ MiniOzoneCluster cluster = MiniOzoneCluster.newBuilder(conf)
|
|
|
+ .setHbInterval(100)
|
|
|
+ .build();
|
|
|
cluster.waitForClusterToBeReady();
|
|
|
|
|
|
try {
|
|
@@ -212,6 +216,8 @@ public class TestStorageContainerManager {
|
|
|
TestStorageContainerManagerHelper helper =
|
|
|
new TestStorageContainerManagerHelper(cluster, conf);
|
|
|
Map<String, OmKeyInfo> keyLocations = helper.createKeys(numKeys, 4096);
|
|
|
+ // Wait for container report
|
|
|
+ Thread.sleep(1000);
|
|
|
for (OmKeyInfo keyInfo : keyLocations.values()) {
|
|
|
OzoneTestUtils.closeContainers(keyInfo.getKeyLocationVersions(),
|
|
|
cluster.getStorageContainerManager());
|
|
@@ -271,14 +277,15 @@ public class TestStorageContainerManager {
|
|
|
public void testBlockDeletingThrottling() throws Exception {
|
|
|
int numKeys = 15;
|
|
|
OzoneConfiguration conf = new OzoneConfiguration();
|
|
|
+ conf.setTimeDuration(HDDS_CONTAINER_REPORT_INTERVAL, 1, TimeUnit.SECONDS);
|
|
|
conf.setInt(ScmConfigKeys.OZONE_SCM_BLOCK_DELETION_MAX_RETRY, 5);
|
|
|
conf.setTimeDuration(OzoneConfigKeys.OZONE_BLOCK_DELETING_SERVICE_INTERVAL,
|
|
|
- 1000, TimeUnit.MILLISECONDS);
|
|
|
+ 100, TimeUnit.MILLISECONDS);
|
|
|
conf.setInt(ScmConfigKeys.OZONE_SCM_CONTAINER_PROVISION_BATCH_SIZE,
|
|
|
numKeys);
|
|
|
|
|
|
MiniOzoneCluster cluster = MiniOzoneCluster.newBuilder(conf)
|
|
|
- .setHbInterval(5000)
|
|
|
+ .setHbInterval(1000)
|
|
|
.setHbProcessorInterval(3000)
|
|
|
.build();
|
|
|
cluster.waitForClusterToBeReady();
|
|
@@ -298,6 +305,8 @@ public class TestStorageContainerManager {
|
|
|
TestStorageContainerManagerHelper helper =
|
|
|
new TestStorageContainerManagerHelper(cluster, conf);
|
|
|
Map<String, OmKeyInfo> keyLocations = helper.createKeys(numKeys, 4096);
|
|
|
+ // Wait for container report
|
|
|
+ Thread.sleep(5000);
|
|
|
for (OmKeyInfo keyInfo : keyLocations.values()) {
|
|
|
OzoneTestUtils.closeContainers(keyInfo.getKeyLocationVersions(),
|
|
|
cluster.getStorageContainerManager());
|