Skip to content

Commit b9aac06

Browse files
committed
massage flaky test
1 parent ed6463a commit b9aac06

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/jasmine/tests/transition_test.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ describe('Plotly.react transitions:', function() {
304304
});
305305

306306
if(failEarly) {
307+
// Reset spy counters even if test fails (to avoid causing subsequent tests to fail)
308+
resetSpyCounters();
307309
return fail(_msg + '- Wrong calls, assertSpies early fail');
308310
}
309311

@@ -334,6 +336,8 @@ describe('Plotly.react transitions:', function() {
334336

335337
// sanity check
336338
if(actuals.length !== exps.length) {
339+
// Reset spy counters even if test fails (to avoid causing subsequent tests to fail)
340+
resetSpyCounters();
337341
return fail(_msg + '- Something went wrong when building "actual" callData list');
338342
}
339343

@@ -628,15 +632,13 @@ describe('Plotly.react transitions:', function() {
628632
layout.xaxis.range = [-2, 2];
629633
return Plotly.react(gd, data, layout);
630634
})
631-
.then(delay(50))
635+
.then(delay(300))
632636
.then(function() {
633637
assertSpies('just layout transition', [
634638
[Plots, 'transitionFromReact', 1],
635639
[gd._fullLayout._basePlotModules[0], 'transitionAxes', 1],
636640
[Axes, 'drawOne', 1],
637641
[Axes, 'drawOne', 1],
638-
[Axes, 'drawOne', 1],
639-
[Axes, 'drawOne', 1],
640642
// one _module.plot call from the relayout at end of axis transition
641643
[Registry, 'call', ['relayout', gd, {'xaxis.range': [-2, 2]}]],
642644
[Axes, 'drawOne', 1],

0 commit comments

Comments
 (0)