I'd looked at that previously, but now sure how we can use that here. AppenderTracker.LINGERING_TIMEOUT is final static so we can't shorten it for testing-- but even that type of testing (shortening) is subjective because we still have to wait and too short of a wait could cause race conditions causing testing inconsistency such as when we are testing multiple closures. Given that the thread to do the clean up is basing it's decision to clean on current time vs the last event (difference being LINGERING_TIMEOUT), unless we inject an artificial clock that we can increment on demand I'm not sure this can be tested without wall-clock sleeps. |