HDFS-17605. Reduce memory overhead of TestBPOfferService (#6996)
This commit is contained in:
parent
e5b76dc99f
commit
df08e0de41
@ -144,8 +144,9 @@ public void setupMocks() throws Exception {
|
|||||||
mockNN2 = setupNNMock(1);
|
mockNN2 = setupNNMock(1);
|
||||||
|
|
||||||
// Set up a mock DN with the bare-bones configuration
|
// Set up a mock DN with the bare-bones configuration
|
||||||
// objects, etc.
|
// objects, etc. Set as stubOnly to save memory and avoid Mockito holding
|
||||||
mockDn = Mockito.mock(DataNode.class);
|
// references to each invocation. This can cause OOM in some runs.
|
||||||
|
mockDn = Mockito.mock(DataNode.class, Mockito.withSettings().stubOnly());
|
||||||
Mockito.doReturn(true).when(mockDn).shouldRun();
|
Mockito.doReturn(true).when(mockDn).shouldRun();
|
||||||
Configuration conf = new Configuration();
|
Configuration conf = new Configuration();
|
||||||
File dnDataDir = new File(new File(TEST_BUILD_DATA, "dfs"), "data");
|
File dnDataDir = new File(new File(TEST_BUILD_DATA, "dfs"), "data");
|
||||||
|
Loading…
Reference in New Issue
Block a user