[tor-commits] [collector/master] Avoid code duplication in SchedulerTest, i.e. use method from MainTest instead.

karsten at torproject.org karsten at torproject.org
Thu Aug 11 18:06:57 UTC 2016


commit 2fc5e232c1fefcfe9449c0b03dcbd3dd97294f11
Author: iwakeh <iwakeh at torproject.org>
Date:   Thu Aug 11 14:08:39 2016 +0200

    Avoid code duplication in SchedulerTest, i.e. use method from MainTest instead.
---
 src/test/java/org/torproject/collector/cron/SchedulerTest.java | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/torproject/collector/cron/SchedulerTest.java b/src/test/java/org/torproject/collector/cron/SchedulerTest.java
index 6314a8d..cec182a 100644
--- a/src/test/java/org/torproject/collector/cron/SchedulerTest.java
+++ b/src/test/java/org/torproject/collector/cron/SchedulerTest.java
@@ -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());
   }
 }



More information about the tor-commits mailing list