/** * Wait for the cluster to be idle. This is intended to be used with Simulated time and is for internal testing. * Note that this does not wait for spout or bolt executors to be idle. * * @throws InterruptedException if interrupted while waiting. * @throws AssertionError if the cluster did not come to an idle point with a timeout. */ public void waitForIdle() throws InterruptedException { waitForIdle(Testing.TEST_TIMEOUT_MS); }
@Override public void advanceClusterTime(int secs, int incSecs) throws InterruptedException { waitForIdle(); for (int amountLeft = secs; amountLeft > 0; amountLeft -= incSecs) { int diff = Math.min(incSecs, amountLeft); Time.advanceTimeSecs(diff); waitForIdle(); } }