Skip to content
Merged
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 @@ -72,6 +72,7 @@
import static org.apache.hadoop.hdds.scm.ScmConfigKeys.OZONE_SCM_STALENODE_INTERVAL;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;

Expand Down Expand Up @@ -212,7 +213,8 @@ public void testDeleteKeyWithSlowFollower() throws Exception {
KeyOutputStream groupOutputStream = (KeyOutputStream) key.getOutputStream();
List<OmKeyLocationInfo> locationInfoList =
groupOutputStream.getLocationInfoList();
Assert.assertEquals(1, locationInfoList.size());
Assume.assumeTrue("Expected exactly a single location, but got: " +
locationInfoList.size(), 1 == locationInfoList.size());
OmKeyLocationInfo omKeyLocationInfo = locationInfoList.get(0);
long containerID = omKeyLocationInfo.getContainerID();
// A container is created on the datanode. Now figure out a follower node to
Expand All @@ -224,7 +226,7 @@ public void testDeleteKeyWithSlowFollower() throws Exception {
cluster.getStorageContainerManager().getPipelineManager()
.getPipelines(new RatisReplicationConfig(
HddsProtos.ReplicationFactor.THREE));
Assert.assertTrue(pipelineList.size() >= FACTOR_THREE_PIPELINE_COUNT);
Assume.assumeTrue(pipelineList.size() >= FACTOR_THREE_PIPELINE_COUNT);
Pipeline pipeline = pipelineList.get(0);
for (HddsDatanodeService dn : cluster.getHddsDatanodes()) {
if (RatisTestHelper.isRatisFollower(dn, pipeline)) {
Expand All @@ -233,10 +235,9 @@ public void testDeleteKeyWithSlowFollower() throws Exception {
leader = dn;
}
}
Assert.assertNotNull(follower);
Assert.assertNotNull(leader);
Assume.assumeNotNull(follower, leader);
//ensure that the chosen follower is still a follower
Assert.assertTrue(RatisTestHelper.isRatisFollower(follower, pipeline));
Assume.assumeTrue(RatisTestHelper.isRatisFollower(follower, pipeline));
// shutdown the follower node
cluster.shutdownHddsDatanode(follower.getDatanodeDetails());
key.write(testData);
Expand Down