HDDS-2168. TestOzoneManagerDoubleBufferWithOMResponse sometimes fails with out of memory error (#1509)
This commit is contained in:
parent
6917754ba7
commit
a3463812ef
@ -85,7 +85,8 @@ public class TestOzoneManagerDoubleBufferWithOMResponse {
|
|||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setup() throws IOException {
|
public void setup() throws IOException {
|
||||||
ozoneManager = Mockito.mock(OzoneManager.class);
|
ozoneManager = Mockito.mock(OzoneManager.class,
|
||||||
|
Mockito.withSettings().stubOnly());
|
||||||
omMetrics = OMMetrics.create();
|
omMetrics = OMMetrics.create();
|
||||||
OzoneConfiguration ozoneConfiguration = new OzoneConfiguration();
|
OzoneConfiguration ozoneConfiguration = new OzoneConfiguration();
|
||||||
ozoneConfiguration.set(OMConfigKeys.OZONE_OM_DB_DIRS,
|
ozoneConfiguration.set(OMConfigKeys.OZONE_OM_DB_DIRS,
|
||||||
@ -125,7 +126,7 @@ public void testDoubleBuffer() throws Exception {
|
|||||||
testDoubleBuffer(1, 10);
|
testDoubleBuffer(1, 10);
|
||||||
testDoubleBuffer(10, 100);
|
testDoubleBuffer(10, 100);
|
||||||
testDoubleBuffer(100, 100);
|
testDoubleBuffer(100, 100);
|
||||||
testDoubleBuffer(1000, 100);
|
testDoubleBuffer(1000, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -373,14 +374,15 @@ public void testDoubleBuffer(int iterations, int bucketCount)
|
|||||||
setup();
|
setup();
|
||||||
for (int i = 0; i < iterations; i++) {
|
for (int i = 0; i < iterations; i++) {
|
||||||
Daemon d1 = new Daemon(() ->
|
Daemon d1 = new Daemon(() ->
|
||||||
doTransactions(RandomStringUtils.randomAlphabetic(5), bucketCount));
|
doTransactions(RandomStringUtils.randomAlphabetic(5),
|
||||||
|
bucketCount));
|
||||||
d1.start();
|
d1.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
// We are doing +1 for volume transaction.
|
// We are doing +1 for volume transaction.
|
||||||
long expectedTransactions = (bucketCount + 1) * iterations;
|
long expectedTransactions = (bucketCount + 1) * iterations;
|
||||||
GenericTestUtils.waitFor(() -> lastAppliedIndex == expectedTransactions,
|
GenericTestUtils.waitFor(() -> lastAppliedIndex == expectedTransactions,
|
||||||
100, 120000);
|
100, 500000);
|
||||||
|
|
||||||
Assert.assertEquals(expectedTransactions,
|
Assert.assertEquals(expectedTransactions,
|
||||||
doubleBuffer.getFlushedTransactionCount()
|
doubleBuffer.getFlushedTransactionCount()
|
||||||
@ -428,15 +430,6 @@ public void doTransactions(String volumeName, int bucketCount) {
|
|||||||
for (int i=0; i< bucketCount; i++) {
|
for (int i=0; i< bucketCount; i++) {
|
||||||
createBucket(volumeName, UUID.randomUUID().toString(),
|
createBucket(volumeName, UUID.randomUUID().toString(),
|
||||||
trxId.incrementAndGet());
|
trxId.incrementAndGet());
|
||||||
// For every 100 buckets creation adding 100ms delay
|
|
||||||
|
|
||||||
if (i % 100 == 0) {
|
|
||||||
try {
|
|
||||||
Thread.sleep(100);
|
|
||||||
} catch (Exception ex) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user