From d3367a7dc306d68eea5f94b3a1479fdb2fea90d3 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Thu, 10 Mar 2016 15:27:51 -0500 Subject: [PATCH] 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 --- .../nifi/controller/TestStandardFlowFileQueue.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java index fc33d99c0f..2ba11616e7 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestStandardFlowFileQueue.java @@ -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 flowFiles, FlowFileQueue flowFileQueue) throws IOException { swapOutCalledCount++;