NIFI-1145 Providing delays in tests where resources are being initialized to allow heavily taxed environments sufficient time.

This commit is contained in:
Aldrin Piri 2016-01-04 15:43:17 -05:00
parent c18514fe2f
commit 47453d2c47
4 changed files with 18 additions and 2 deletions

View File

@ -414,11 +414,11 @@ public class TestStandardProcessScheduler {
LongEnablingService ts = (LongEnablingService) serviceNode.getControllerServiceImplementation(); LongEnablingService ts = (LongEnablingService) serviceNode.getControllerServiceImplementation();
ts.setLimit(3000); ts.setLimit(3000);
scheduler.enableControllerService(serviceNode); scheduler.enableControllerService(serviceNode);
Thread.sleep(100); Thread.sleep(500);
assertTrue(serviceNode.isActive()); assertTrue(serviceNode.isActive());
assertEquals(1, ts.enableInvocationCount()); assertEquals(1, ts.enableInvocationCount());
Thread.sleep(100); Thread.sleep(500);
scheduler.disableControllerService(serviceNode); scheduler.disableControllerService(serviceNode);
assertFalse(serviceNode.isActive()); assertFalse(serviceNode.isActive());
assertEquals(ControllerServiceState.DISABLING, serviceNode.getState()); assertEquals(ControllerServiceState.DISABLING, serviceNode.getState());

View File

@ -47,6 +47,8 @@ public class TestInvokeHttpSSL extends TestInvokeHttpCommon {
server = createServer(); server = createServer();
server.startServer(); server.startServer();
// Allow time for the server to start
Thread.sleep(500);
// this is the base url with the random port // this is the base url with the random port
url = server.getSecureUrl(); url = server.getSecureUrl();
} }
@ -64,6 +66,13 @@ public class TestInvokeHttpSSL extends TestInvokeHttpCommon {
runner.enableControllerService(sslService); runner.enableControllerService(sslService);
runner.setProperty(InvokeHTTP.PROP_SSL_CONTEXT_SERVICE, "ssl-context"); runner.setProperty(InvokeHTTP.PROP_SSL_CONTEXT_SERVICE, "ssl-context");
// Allow time for the controller service to fully initialize
Thread.sleep(500);
// Provide more time to setup and run
runner.setProperty(InvokeHTTP.PROP_READ_TIMEOUT, "30 secs");
runner.setProperty(InvokeHTTP.PROP_CONNECT_TIMEOUT, "30 secs");
server.clearHandlers(); server.clearHandlers();
} }

View File

@ -126,6 +126,9 @@ public class TestListenSyslog {
final ProcessContext context = runner.getProcessContext(); final ProcessContext context = runner.getProcessContext();
proc.onScheduled(context); proc.onScheduled(context);
// Allow time for the processor to perform its scheduled start
Thread.sleep(500);
final int numMessages = 20; final int numMessages = 20;
final int port = proc.getPort(); final int port = proc.getPort();
Assert.assertTrue(port > 0); Assert.assertTrue(port > 0);

View File

@ -70,6 +70,8 @@ public class TestServer {
private void createConnector() { private void createConnector() {
final ServerConnector http = new ServerConnector(jetty); final ServerConnector http = new ServerConnector(jetty);
http.setPort(0); http.setPort(0);
// Severely taxed environments may have significant delays when executing.
http.setIdleTimeout(30000L);
jetty.addConnector(http); jetty.addConnector(http);
} }
@ -100,6 +102,8 @@ public class TestServer {
// set host and port // set host and port
https.setPort(0); https.setPort(0);
// Severely taxed environments may have significant delays when executing.
https.setIdleTimeout(30000L);
// add the connector // add the connector
jetty.addConnector(https); jetty.addConnector(https);