mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Maxim Thomas
03.30.2025 61dac86bceb9d727e1bd707982c41ab9467c6d5a
opendj-server-legacy/src/test/java/org/opends/server/util/TestTimer.java
@@ -12,13 +12,17 @@
 * information: "Portions Copyright [year] [name of copyright owner]".
 *
 * Copyright 2015-2016 ForgeRock AS.
 * Portions Copyright 2025 3A Systems LLC.
 */
package org.opends.server.util;
import java.util.concurrent.Callable;
import java.util.concurrent.TimeUnit;
import org.forgerock.i18n.LocalizableMessage;
import org.forgerock.i18n.slf4j.LocalizedLogger;
import org.forgerock.util.Reject;
import org.opends.server.TestCaseUtils;
/**
 * Timer useful for testing: it helps to write loops that repeatedly runs code until some condition
@@ -153,6 +157,7 @@
  /** A {@link TestTimer} that sleeps in steps and sleeps at maximum {@code nbSteps * sleepTimes}. */
  public static class SteppingTimer implements TestTimer
  {
    private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass();
    private final long sleepTime;
    private final long totalNbSteps;
    private long nbStepsRemaining;
@@ -204,6 +209,7 @@
        {
          if (hasTimedOutNoSleep())
          {
            logger.info(LocalizableMessage.raw("failed to wait for" + callable + "\n" + TestCaseUtils.generateThreadDump()));
            throw e;
          }
        }