You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2019/02/11 17:40:32 UTC

[nifi] branch master updated: NIFI-6015: This closes #3300. Updated unit test to sleep for 10 milliseconds before adding last FlowFile to queue so that the first and last FlowFiles will have different timestamps

This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/master by this push:
     new 3a4c3cc  NIFI-6015: This closes #3300. Updated unit test to sleep for 10 milliseconds before adding last FlowFile to queue so that the first and last FlowFiles will have different timestamps
3a4c3cc is described below

commit 3a4c3ccbaae6f443910a264ccc57f48acd21d713
Author: Mark Payne <ma...@hotmail.com>
AuthorDate: Mon Feb 11 11:51:36 2019 -0500

    NIFI-6015: This closes #3300. Updated unit test to sleep for 10 milliseconds before adding last FlowFile to queue so that the first and last FlowFiles will have different timestamps
    
    NIFI-6015: Moved call to sleep() up in unit test to ensure that we sleep before creating the flowfile
    Signed-off-by: joewitt <jo...@apache.org>
---
 .../nifi/controller/repository/TestStandardProcessSession.java     | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java
index 42e61d3..1880864 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/repository/TestStandardProcessSession.java
@@ -1712,12 +1712,17 @@ public class TestStandardProcessSession {
     }
 
     @Test
-    public void testBatchQueuedHaveSameQueuedTime() {
+    public void testBatchQueuedHaveSameQueuedTime() throws InterruptedException {
         for (int i = 0; i < 100; i++) {
+            if (i == 99) {
+                Thread.sleep(10);
+            }
+
             final FlowFileRecord flowFile = new StandardFlowFileRecord.Builder()
                     .id(i)
                     .addAttribute("uuid", "000000000000-0000-0000-0000-0000000" + i)
                     .build();
+
             this.flowFileQueue.put(flowFile);
         }