mirror of https://github.com/apache/nifi.git
nNFI-1618: Updated unit test to use 30,000 FlowFiles to test dropping of swapped out FlowFiles intead of using 210,000. Thiss unit test creates a lot of objects and when reducing the number of FlowFiles generated to 30K instead of 210K, all appears to work okay
This commit is contained in:
parent
73e168e954
commit
d3367a7dc3
|
@ -442,14 +442,13 @@ public class TestStandardFlowFileQueue {
|
|||
assertNull(flowFile);
|
||||
}
|
||||
|
||||
|
||||
@Test(timeout = 120000)
|
||||
public void testDropSwappedFlowFiles() {
|
||||
for (int i = 1; i <= 210000; i++) {
|
||||
for (int i = 1; i <= 30000; i++) {
|
||||
queue.put(new TestFlowFile());
|
||||
}
|
||||
|
||||
assertEquals(20, swapManager.swappedOut.size());
|
||||
assertEquals(2, swapManager.swappedOut.size());
|
||||
final DropFlowFileStatus status = queue.dropFlowFiles("1", "Unit Test");
|
||||
while (status.getState() != DropFlowFileState.COMPLETE) {
|
||||
try {
|
||||
|
@ -461,7 +460,7 @@ public class TestStandardFlowFileQueue {
|
|||
assertEquals(0, queue.size().getObjectCount());
|
||||
assertEquals(0, queue.size().getByteCount());
|
||||
assertEquals(0, swapManager.swappedOut.size());
|
||||
assertEquals(20, swapManager.swapInCalledCount);
|
||||
assertEquals(2, swapManager.swapInCalledCount);
|
||||
}
|
||||
|
||||
|
||||
|
@ -521,10 +520,6 @@ public class TestStandardFlowFileQueue {
|
|||
incompleteSwapFileRecordsToInclude = flowFilesToInclude;
|
||||
}
|
||||
|
||||
public void disableIncompleteSwapFileException() {
|
||||
this.incompleteSwapFileRecordsToInclude = -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String swapOut(List<FlowFileRecord> flowFiles, FlowFileQueue flowFileQueue) throws IOException {
|
||||
swapOutCalledCount++;
|
||||
|
|
Loading…
Reference in New Issue