From 254b20fa5ff3b3a00ccbe80b3a7f8954cb86db49 Mon Sep 17 00:00:00 2001 From: Joe Witt Date: Sun, 22 Mar 2020 09:54:43 -0400 Subject: [PATCH] NIFI-7274 add time for test conditions to be met --- .../controller/scheduling/TestStandardProcessScheduler.java | 4 +++- .../src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java index 90bbbbb5e6..01e368ead5 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java @@ -633,7 +633,9 @@ public class TestStandardProcessScheduler { procNode.performValidation(); scheduler.startProcessor(procNode, true); - Thread.sleep(100L); + while(proc.getOnScheduledInvocationCount() < 1){ + Thread.sleep(100L); + } assertEquals(1, proc.getOnScheduledInvocationCount()); Thread.sleep(100L); assertEquals(1, proc.getOnScheduledInvocationCount()); diff --git a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java index fdad692253..6071474c09 100644 --- a/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java +++ b/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src/test/java/org/apache/nifi/dbcp/DBCPServiceTest.java @@ -420,6 +420,8 @@ public class DBCPServiceTest { server.shutdown(); server.start(); + Thread.sleep(2500L); //allow time to pass for the server to startup. + // Note!! We should not get something like: // org.h2.jdbc.JdbcSQLException: Connection is broken: "session closed" [90067-192] // Pool should remove invalid connections and create new valid connections.