Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #25095 from millermedeiros/1081050-intermittent-da…
Browse files Browse the repository at this point in the history
…y-observer-test

Bug 1081050 - Intermittent calendar/test/unit/day_observer_test.js | "after each" hook - TypeError: this.connection is null (app://calendar.gaiamobile.org/js/db.js?time=1412932298308:155) r=gaye
  • Loading branch information
Gareth Aye committed Oct 14, 2014
2 parents b77e639 + 562b693 commit ad22d7e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/calendar/test/unit/day_observer_test.js
Expand Up @@ -182,8 +182,11 @@ suite('day_observer', function() {
startDate: today
});

subject.on(today, callback);
// it's very important to mock clock BEFORE adding listener!!! otherwise
// we might get an intermittent race condition (easier to reproduce on
// gaia-try and also when running these tests multiple times in a row)
clock = sinon.useFakeTimers();
subject.on(today, callback);
});

teardown(function() {
Expand Down

0 comments on commit ad22d7e

Please sign in to comment.