NIFI-6015: This closes #3300. Updated unit test to sleep for 10 milliseconds before...
authorMark Payne <markap14@hotmail.com>
Mon, 11 Feb 2019 16:51:36 +0000 (11:51 -0500)
committerjoewitt <joewitt@apache.org>
Mon, 11 Feb 2019 17:40:10 +0000 (12:40 -0500)
NIFI-6015: Moved call to sleep() up in unit test to ensure that we sleep before creating the flowfile
Signed-off-by: joewitt <joewitt@apache.org>
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 (file)
@@ -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);
         }