public void testWatchdogDoesNotFailForObjectsThatAreNearTheDeadline() throws Exception {
  CountDownLatch latch=new CountDownLatch(5);
  createSlowFinalizer(1,latch);
  createSlowFinalizer(1000,latch);
  createSlowFinalizer(2000,latch);
  createSlowFinalizer(4000,latch);
  createSlowFinalizer(8000,latch);
  FinalizationTester.induceFinalization();
  assertTrue(latch.await(20,TimeUnit.SECONDS));
}

public void testWatchdogDoesNotFailForObjectsThatAreNearTheDeadline ( ) throws Exception { CountDownLatch latch = new CountDownLatch ( 5 ) ; createSlowFinalizer ( 1 , latch ) ; createSlowFinalizer ( 1000 , latch ) ; createSlowFinalizer ( 2000 , latch ) ; createSlowFinalizer ( 4000 , latch ) ; createSlowFinalizer ( 8000 , latch ) ; FinalizationTester . induceFinalization ( ) ; assertTrue ( latch . await ( 20 , TimeUnit . SECONDS ) ) ; }
the finalizer watch dog exits the vm if any object takes more than 10 s to finalize . check that objects near that limit are okay .
