From c4da3933c29b466e4bacae9d63149a4e655398bf Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 5 May 2021 10:58:33 -0400 Subject: [PATCH 1/4] adjust karma config --- test/jasmine/karma.conf.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/jasmine/karma.conf.js b/test/jasmine/karma.conf.js index c44111b421e..d9c15919299 100644 --- a/test/jasmine/karma.conf.js +++ b/test/jasmine/karma.conf.js @@ -220,6 +220,9 @@ func.defaultConfig = { // how long will Karma wait for a message from a browser before disconnecting (30 ms) browserNoActivityTimeout: 30000, + // how long does Karma wait for a browser to reconnect (in ms). + browserDisconnectTimeout: 30000, + // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher // From a159b272c3be2b1575db3d59feaede3020e63560 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 5 May 2021 13:03:26 -0400 Subject: [PATCH 2/4] call destroyGraphDiv without purge --- test/jasmine/tests/parcoords_test.js | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/test/jasmine/tests/parcoords_test.js b/test/jasmine/tests/parcoords_test.js index db11d7caf3f..2a9187794c9 100644 --- a/test/jasmine/tests/parcoords_test.js +++ b/test/jasmine/tests/parcoords_test.js @@ -58,14 +58,6 @@ function mostOfDrag(x1, y1, x2, y2) { mouseEvent('mousemove', x2, y2); } -function purgeGraphDiv(done) { - var gd = d3Select('.js-plotly-plot').node(); - if(gd) Plotly.purge(gd); - destroyGraphDiv(); - - return delay(50)().then(done); -} - function getAvgPixelByChannel(id) { var canvas = d3Select(id).node(); @@ -376,7 +368,7 @@ describe('parcoords edge cases', function() { gd = createGraphDiv(); }); - afterEach(purgeGraphDiv); + afterEach(destroyGraphDiv); it('@gl Works fine with one panel only', function(done) { var mockCopy = Lib.extendDeep({}, mock2); @@ -645,7 +637,7 @@ describe('parcoords edge cases', function() { describe('parcoords Lifecycle methods', function() { var gd; beforeEach(function() { gd = createGraphDiv(); }); - afterEach(purgeGraphDiv); + afterEach(destroyGraphDiv); it('Plotly.deleteTraces with one trace removes the plot', function(done) { var mockCopy = Lib.extendDeep({}, mock); @@ -915,7 +907,7 @@ describe('parcoords basic use', function() { gd = createGraphDiv(); }); - afterEach(purgeGraphDiv); + afterEach(destroyGraphDiv); it('@gl should create three WebGL contexts per graph', function(done) { Plotly.react(gd, mockCopy) @@ -1223,7 +1215,7 @@ describe('parcoords react more attributes', function() { gd = createGraphDiv(); }); - afterEach(purgeGraphDiv); + afterEach(destroyGraphDiv); it('@gl should change various axis parameters', function(done) { Plotly.react(gd, mock3) @@ -1372,7 +1364,7 @@ describe('parcoords constraint interactions - without defined axis ranges', func }); afterAll(function() { - purgeGraphDiv(); + destroyGraphDiv(); PC.bar.snapDuration = initialSnapDuration; }); @@ -1380,7 +1372,7 @@ describe('parcoords constraint interactions - without defined axis ranges', func gd = createGraphDiv(); }); - afterEach(purgeGraphDiv); + afterEach(destroyGraphDiv); function getDashArray(index) { var highlight = document.querySelectorAll('.highlight')[index]; @@ -1658,7 +1650,7 @@ describe('parcoords constraint interactions - with defined axis ranges', functio }); afterAll(function() { - purgeGraphDiv(); + destroyGraphDiv(); PC.bar.snapDuration = initialSnapDuration; }); @@ -1666,7 +1658,7 @@ describe('parcoords constraint interactions - with defined axis ranges', functio gd = createGraphDiv(); }); - afterEach(purgeGraphDiv); + afterEach(destroyGraphDiv); it('@gl updates constraints above and below axis ranges', function(done) { var x = 295; @@ -1740,7 +1732,7 @@ describe('parcoords constraint click interactions - with pre-defined constraint }); afterAll(function() { - purgeGraphDiv(); + destroyGraphDiv(); PC.bar.snapDuration = initialSnapDuration; }); @@ -1748,7 +1740,7 @@ describe('parcoords constraint click interactions - with pre-defined constraint gd = createGraphDiv(); }); - afterEach(purgeGraphDiv); + afterEach(destroyGraphDiv); it('@gl should not drop constraintrange on click', function(done) { Plotly.react(gd, initialFigure()) From afd5fac34fd3c5a149526828a02a24e10fb3c388 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 5 May 2021 13:08:19 -0400 Subject: [PATCH 3/4] set and increase jasmine timout before each gl test --- test/jasmine/tests/parcoords_test.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/test/jasmine/tests/parcoords_test.js b/test/jasmine/tests/parcoords_test.js index 2a9187794c9..ed0eed4c48c 100644 --- a/test/jasmine/tests/parcoords_test.js +++ b/test/jasmine/tests/parcoords_test.js @@ -363,7 +363,7 @@ describe('parcoords initialization tests', function() { describe('parcoords edge cases', function() { var gd; beforeEach(function() { - jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000; gd = createGraphDiv(); }); @@ -636,7 +636,10 @@ describe('parcoords edge cases', function() { describe('parcoords Lifecycle methods', function() { var gd; - beforeEach(function() { gd = createGraphDiv(); }); + beforeEach(function() { + jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000; + gd = createGraphDiv(); + }); afterEach(destroyGraphDiv); it('Plotly.deleteTraces with one trace removes the plot', function(done) { @@ -896,7 +899,7 @@ describe('parcoords basic use', function() { var gd; beforeEach(function() { - jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; + jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000; mockCopy = Lib.extendDeep({}, mock); mockCopy.data[0].domain = { @@ -1212,6 +1215,7 @@ describe('parcoords react more attributes', function() { var gd; beforeEach(function() { + jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000; gd = createGraphDiv(); }); @@ -1357,8 +1361,6 @@ describe('parcoords constraint interactions - without defined axis ranges', func var snapDelay = 100; var noSnapDelay = 20; beforeAll(function() { - jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; - initialSnapDuration = PC.bar.snapDuration; PC.bar.snapDuration = shortenedSnapDuration; }); @@ -1369,6 +1371,7 @@ describe('parcoords constraint interactions - without defined axis ranges', func }); beforeEach(function() { + jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000; gd = createGraphDiv(); }); @@ -1643,8 +1646,6 @@ describe('parcoords constraint interactions - with defined axis ranges', functio var shortenedSnapDuration = 20; var noSnapDelay = 20; beforeAll(function() { - jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000; - initialSnapDuration = PC.bar.snapDuration; PC.bar.snapDuration = shortenedSnapDuration; }); @@ -1655,6 +1656,7 @@ describe('parcoords constraint interactions - with defined axis ranges', functio }); beforeEach(function() { + jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000; gd = createGraphDiv(); }); @@ -1737,6 +1739,7 @@ describe('parcoords constraint click interactions - with pre-defined constraint }); beforeEach(function() { + jasmine.DEFAULT_TIMEOUT_INTERVAL = 15000; gd = createGraphDiv(); }); From 9da91af0fb42064dc4426d2bb3d5792327a07f2c Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 5 May 2021 13:21:33 -0400 Subject: [PATCH 4/4] increase karma timeout config --- test/jasmine/karma.conf.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/jasmine/karma.conf.js b/test/jasmine/karma.conf.js index d9c15919299..c52e76048a0 100644 --- a/test/jasmine/karma.conf.js +++ b/test/jasmine/karma.conf.js @@ -218,10 +218,10 @@ func.defaultConfig = { singleRun: argv.nowatch, // how long will Karma wait for a message from a browser before disconnecting (30 ms) - browserNoActivityTimeout: 30000, + browserNoActivityTimeout: 60000, // how long does Karma wait for a browser to reconnect (in ms). - browserDisconnectTimeout: 30000, + browserDisconnectTimeout: 60000, // start these browsers // available browser launchers: https://npmjs.org/browse/keyword/karma-launcher