private void extendSize() {
   long minSize = TimeUtils.daysToMillis(SKConstants.TEST_QUEUE_NORMAL_SIZE_IN_DAYS);
   long currentSize = endTime - System.currentTimeMillis();
   if (currentSize < minSize) {
     SKLogger.d(this, "extending queue");
     long maxSize = TimeUtils.daysToMillis(SKConstants.TEST_QUEUE_MAX_SIZE_IN_DAYS);
     long newEndSize = System.currentTimeMillis() + maxSize;
     populate(newEndSize);
   } else {
     SKLogger.d(this, "no need to extend queue, endTime: " + TimeUtils.logString(endTime));
   }
 }
  public ScheduledTestExecutionQueue(TestContext tc) {
    this.tc = tc;
    accumulatedTestBytes = 0L;
    startTime = endTime = System.currentTimeMillis();

    long daysDiff = TimeUtils.daysToMillis(SKConstants.TEST_QUEUE_MAX_SIZE_IN_DAYS);
    long newEndTime = startTime + daysDiff;
    populate(newEndTime);
  }
 private long getSleepTimeDurationMilliseconds() {
   if (entries.isEmpty()) {
     return TimeUtils.daysToMillis(SKConstants.TEST_QUEUE_NORMAL_SIZE_IN_DAYS);
   } else {
     QueueEntry entry = entries.peek();
     long value = entry.getSystemTimeMilliseconds() - System.currentTimeMillis();
     return value;
   }
 }