summaryrefslogtreecommitdiffstats
path: root/sync/sessions
diff options
context:
space:
mode:
authorrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-15 00:11:10 +0000
committerrlarocque@chromium.org <rlarocque@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-15 00:12:09 +0000
commitb1f55bfeef8f8c87571e51a340dc51ed46cd7a0d (patch)
tree6bf39db2edc96fb2ac3fb96073e40a26cf49f8b2 /sync/sessions
parent7b5f3b5c8e4a33e01059ba0ed0036a49ec99ae77 (diff)
downloadchromium_src-b1f55bfeef8f8c87571e51a340dc51ed46cd7a0d.zip
chromium_src-b1f55bfeef8f8c87571e51a340dc51ed46cd7a0d.tar.gz
chromium_src-b1f55bfeef8f8c87571e51a340dc51ed46cd7a0d.tar.bz2
sync: Attempt to fix sync scheduler test flakiness
Increases the delay duration in several sync scheduler unit tests. According to [1], the timer resolution on Windows may be under 1ms. We suspect the low timer resolution compbined with very short delays could cause problems in some unit tests. This will make the tests slower, but hopefully it will make them more reliable, too. Changes a timestmap comparison in nudge_tracker.cc from < to <=. We suspect that a lower timer resolution might allow two Time::Now() calls that should be separated by a >1ms gap of time might still return the same value in both calls. If this did happen, it could be the cause of misbehaving unit tests. It is believed that these issues only affect tests. The delay lengths used in the real world should be much longer than 1ms. The timer resolution should not be an issue for delays of that length. [1] http://www.chromium.org/developers/design-documents/threading BUG=402212 Review URL: https://codereview.chromium.org/463563005 Cr-Commit-Position: refs/heads/master@{#289731} git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289731 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/sessions')
-rw-r--r--sync/sessions/nudge_tracker.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sync/sessions/nudge_tracker.cc b/sync/sessions/nudge_tracker.cc
index a0bdbda..d9aaec6 100644
--- a/sync/sessions/nudge_tracker.cc
+++ b/sync/sessions/nudge_tracker.cc
@@ -63,7 +63,7 @@ bool NudgeTracker::IsRetryRequired() const {
if (current_retry_time_.is_null())
return false;
- return current_retry_time_ < sync_cycle_start_time_;
+ return current_retry_time_ <= sync_cycle_start_time_;
}
void NudgeTracker::RecordSuccessfulSyncCycle() {
@@ -300,7 +300,7 @@ void NudgeTracker::SetSyncCycleStartTime(base::TimeTicks now) {
// it is ready to go, then we set it as the current_retry_time_. It will stay
// there until a GU retry has succeeded.
if (!next_retry_time_.is_null() &&
- next_retry_time_ < sync_cycle_start_time_) {
+ next_retry_time_ <= sync_cycle_start_time_) {
current_retry_time_ = next_retry_time_;
next_retry_time_ = base::TimeTicks();
}