Skip to content

Commit

Permalink
Don't schedule feed checks during tests
Browse files Browse the repository at this point in the history
Tests create lots of fake feeds with invalid URLs, so auto-updating
would otherwise hang and block the explicit feed updates done by other
tests.
  • Loading branch information
dstillman committed Jun 20, 2017
1 parent c11f106 commit a2d874c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions chrome/content/zotero/xpcom/data/feeds.js
Expand Up @@ -32,9 +32,14 @@ Zotero.Feeds = new function() {

this.init = function () {
// Delay initialization for tests
_initPromise = Zotero.Schema.schemaUpdatePromise.delay(5000).then(() => {
this.scheduleNextFeedCheck().then(() => _initPromise = null);
});
_initPromise = Zotero.Schema.schemaUpdatePromise.delay(5000)
.then(() => {
// Don't run feed checks randomly during tests
if (Zotero.test) return;

return this.scheduleNextFeedCheck();
})
.then(() => _initPromise = null);

Zotero.SyncedSettings.onSyncDownload.addListener(Zotero.Libraries.userLibraryID, 'feeds',
(oldValue, newValue, conflict) => {
Expand All @@ -52,7 +57,7 @@ Zotero.Feeds = new function() {
if (_initPromise) {
await _initPromise;
}
Zotero.Feeds.updateFeeds();
await Zotero.Feeds.updateFeeds();
}
},
},
Expand Down

0 comments on commit a2d874c

Please sign in to comment.