Commit 2fc5e232 authored by iwakeh's avatar iwakeh 🌴
Browse files

Avoid code duplication in SchedulerTest, i.e. use method from MainTest instead.

parent 9bf14011
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ package org.torproject.collector.cron;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import org.torproject.collector.MainTest;
import org.torproject.collector.conf.Configuration;
import org.torproject.collector.conf.Key;

@@ -97,9 +98,7 @@ public class SchedulerTest {
        schedulerField.get(Scheduler.getInstance());
    Scheduler.getInstance().scheduleModuleRuns(ctms, conf);
    long sysNow = System.currentTimeMillis();
    while (System.currentTimeMillis() - sysNow < 180_000) {
      try { Thread.sleep(10_000);} catch (Exception e) { /* ignored */ }
    }
    MainTest.waitSec(180);
    assertEquals(15, Broken.count.intValue());
  }
}