adjust tests to make them more travis CI compatible

This commit is contained in:
Greg Wilkins 2013-04-11 08:32:51 +10:00
parent 5637db66e8
commit e8d9625dcc
2 changed files with 6 additions and 3 deletions

View File

@ -146,6 +146,7 @@ public class ShutdownMonitor
{
if (isAlive())
{
// TODO why are we reentrant here?
if (DEBUG)
System.err.printf("ShutdownMonitorThread already started");
return; // cannot start it again
@ -353,7 +354,9 @@ public class ShutdownMonitor
{
if (thread != null && thread.isAlive())
{
System.err.printf("ShutdownMonitorThread already started");
// TODO why are we reentrant here?
if (DEBUG)
System.err.printf("ShutdownMonitorThread already started");
return; // cannot start it again
}

View File

@ -80,13 +80,14 @@ public class LowResourcesMonitorTest
@Test
public void testLowOnThreads() throws Exception
{
Thread.sleep(1200);
_threadPool.setMaxThreads(_threadPool.getThreads()-_threadPool.getIdleThreads()+10);
Thread.sleep(1200);
Assert.assertFalse(_lowResourcesMonitor.isLowOnResources());
final CountDownLatch latch = new CountDownLatch(1);
for (int i=0;i<20;i++)
for (int i=0;i<100;i++)
{
_threadPool.dispatch(new Runnable()
{
@ -110,7 +111,6 @@ public class LowResourcesMonitorTest
latch.countDown();
Thread.sleep(1200);
System.err.println(_threadPool.dump());
Assert.assertFalse(_lowResourcesMonitor.isLowOnResources());
}