HDFS-12181. Ozone: Fix TestContainerReplicationManager by setting proper log level for LogCapturer. Contributed by Mukul Kumar Singh.
This commit is contained in:
parent
ca096501bf
commit
eda559ffd2
@ -64,7 +64,7 @@
|
|||||||
* computes the replication levels for each container.
|
* computes the replication levels for each container.
|
||||||
*/
|
*/
|
||||||
public class ContainerReplicationManager implements Closeable {
|
public class ContainerReplicationManager implements Closeable {
|
||||||
static final Logger LOG =
|
public static final Logger LOG =
|
||||||
LoggerFactory.getLogger(ContainerReplicationManager.class);
|
LoggerFactory.getLogger(ContainerReplicationManager.class);
|
||||||
|
|
||||||
private final NodePoolManager poolManager;
|
private final NodePoolManager poolManager;
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
import org.apache.hadoop.ozone.scm.node.NodePoolManager;
|
import org.apache.hadoop.ozone.scm.node.NodePoolManager;
|
||||||
import org.apache.hadoop.test.GenericTestUtils;
|
import org.apache.hadoop.test.GenericTestUtils;
|
||||||
import org.apache.hadoop.test.GenericTestUtils.LogCapturer;
|
import org.apache.hadoop.test.GenericTestUtils.LogCapturer;
|
||||||
import org.apache.log4j.Level;
|
import org.slf4j.event.Level;
|
||||||
import org.junit.After;
|
import org.junit.After;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
import org.junit.Before;
|
import org.junit.Before;
|
||||||
@ -74,10 +74,12 @@ public class TestContainerReplicationManager {
|
|||||||
@After
|
@After
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
logCapturer.stopCapturing();
|
logCapturer.stopCapturing();
|
||||||
|
GenericTestUtils.setLogLevel(ContainerReplicationManager.LOG, Level.INFO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
GenericTestUtils.setLogLevel(ContainerReplicationManager.LOG, Level.DEBUG);
|
||||||
Map<DatanodeID, NodeManager.NODESTATE> nodeStateMap = new HashMap<>();
|
Map<DatanodeID, NodeManager.NODESTATE> nodeStateMap = new HashMap<>();
|
||||||
// We are setting up 3 pools with 24 nodes each in this cluster.
|
// We are setting up 3 pools with 24 nodes each in this cluster.
|
||||||
// First we create 72 Datanodes.
|
// First we create 72 Datanodes.
|
||||||
@ -234,7 +236,7 @@ public void testAddingNewPoolWorks()
|
|||||||
throws TimeoutException, InterruptedException, IOException {
|
throws TimeoutException, InterruptedException, IOException {
|
||||||
LogCapturer inProgressLog = LogCapturer.captureLogs(
|
LogCapturer inProgressLog = LogCapturer.captureLogs(
|
||||||
LogFactory.getLog(InProgressPool.class));
|
LogFactory.getLog(InProgressPool.class));
|
||||||
GenericTestUtils.setLogLevel(InProgressPool.LOG, Level.ALL);
|
GenericTestUtils.setLogLevel(InProgressPool.LOG, Level.DEBUG);
|
||||||
try {
|
try {
|
||||||
DatanodeID id = SCMTestUtils.getDatanodeID();
|
DatanodeID id = SCMTestUtils.getDatanodeID();
|
||||||
((ReplicationNodeManagerMock) (nodeManager)).addNode(id, NodeManager
|
((ReplicationNodeManagerMock) (nodeManager)).addNode(id, NodeManager
|
||||||
|
Loading…
Reference in New Issue
Block a user