From faa83aee2133dd4120311b9f77096a1a29f5f91e Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Thu, 17 May 2012 17:59:14 -0700 Subject: [PATCH] Increased timing tolerance for sync repeat tests --- .../astrid/sync/repeats/AbstractSyncRepeatTests.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java b/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java index dbdb4b3f2..4964c34c9 100644 --- a/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java +++ b/tests-sync/src/com/todoroo/astrid/sync/repeats/AbstractSyncRepeatTests.java @@ -88,9 +88,8 @@ abstract public class AbstractSyncRepeatTests extends DatabaseTest protected void assertTimesMatch(long expectedTime, long newDueDate) { assertTrue(String.format("Expected %s, was %s", new Date(expectedTime), new Date(newDueDate)), - Math.abs(expectedTime - newDueDate) <= 60000); - // Timing issues between client and server can cause times to be off by one minute. - // Since our smallest interval is 5 minutes, this shouldn't be an issue + Math.abs(expectedTime - newDueDate) <= 600000); + // Allow a few minutes of variance to account for timing issues in tests } /* @@ -127,7 +126,7 @@ abstract public class AbstractSyncRepeatTests extends DatabaseTest if (rrule == null) { rrule = new RRule(); rrule.setFreq(frequency); - int interval = 2; + int interval = frequency.equals(Frequency.MINUTELY) ? 100: 2; rrule.setInterval(interval); } t.setValue(Task.RECURRENCE, rrule.toIcal());