From 6a8c2dba12ea852d2b43162196adc6587854fbbf Mon Sep 17 00:00:00 2001 From: Bryan Bende Date: Tue, 1 Dec 2015 21:24:32 -0500 Subject: [PATCH] NIFI-1237 Reducing number of messages sent in testBatching() to be less than size of ListenSyslog's internal queue Signed-off-by: joewitt --- .../apache/nifi/processors/standard/TestListenSyslog.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java index d9dc8f0e82..8fdca7f6c8 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListenSyslog.java @@ -230,7 +230,9 @@ public class TestListenSyslog { final ProcessContext context = runner.getProcessContext(); proc.onScheduled(context); - final int numMessages = 20; + // the processor has internal blocking queue with capacity 10 so we have to send + // less than that since we are sending all messages before the processors ever runs + final int numMessages = 5; final int port = proc.getPort(); Assert.assertTrue(port > 0); @@ -251,7 +253,7 @@ public class TestListenSyslog { final String content = new String(flowFile.toByteArray(), StandardCharsets.UTF_8); final String[] splits = content.split("\\|"); - Assert.assertEquals(20, splits.length); + Assert.assertEquals(numMessages, splits.length); final List events = runner.getProvenanceEvents(); Assert.assertNotNull(events);