adjust tests to make them more travis CI compatible
This commit is contained in:
parent
5637db66e8
commit
e8d9625dcc
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue