diff options
author | Simon Knox <psimyn@gmail.com> | 2017-10-26 18:53:52 +0300 |
---|---|---|
committer | Simon Knox <psimyn@gmail.com> | 2017-10-27 15:13:18 +0300 |
commit | 1d298e4939c5230251d5bc3ad9a58ec34196e4b1 (patch) | |
tree | 647a9cdf5318ec372f2435856596564ee8745e17 | |
parent | 9101cce2a7c30a832b3d97d84cd53ca503a163d1 (diff) | |
download | gitlab-ce-1d298e4939c5230251d5bc3ad9a58ec34196e4b1.tar.gz |
add changelog and spec
-rw-r--r-- | changelogs/unreleased/38394-smarter-interval.yml | 5 | ||||
-rw-r--r-- | spec/javascripts/smart_interval_spec.js | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/changelogs/unreleased/38394-smarter-interval.yml b/changelogs/unreleased/38394-smarter-interval.yml new file mode 100644 index 00000000000..e641534813e --- /dev/null +++ b/changelogs/unreleased/38394-smarter-interval.yml @@ -0,0 +1,5 @@ +--- +title: improve merge request realtime polling performance +merge_request: +author: +type: fixed diff --git a/spec/javascripts/smart_interval_spec.js b/spec/javascripts/smart_interval_spec.js index c602eda9560..bc835198242 100644 --- a/spec/javascripts/smart_interval_spec.js +++ b/spec/javascripts/smart_interval_spec.js @@ -58,6 +58,18 @@ import '~/smart_interval'; done(); }, DEFAULT_LONG_TIMEOUT); }); + + it('does not increment while waiting for callback', function (done) { + const smartInterval = createDefaultSmartInterval({ + callback: () => new Promise($.noop), + }); + + setTimeout(() => { + const oneInterval = smartInterval.cfg.startingInterval * DEFAULT_INCREMENT_FACTOR; + expect(smartInterval.getCurrentInterval()).toEqual(oneInterval); + done(); + }, DEFAULT_SHORT_TIMEOUT); + }); }); describe('Public methods', function () { |