Skip to content

Commit 24aafc8

Browse files
committed
Apply Etienne recommendations
reset shard limit to 20 and retry to 5 revised timout as well as before and after functions in describe blocks in gl2d_plot_interact_test lower the shard limit for the non-gl test-jasmine commands
1 parent 305e0b3 commit 24aafc8

File tree

3 files changed

+25
-10
lines changed

3 files changed

+25
-10
lines changed

.circleci/test.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ set +o pipefail
66

77
ROOT=$(dirname $0)/..
88
EXIT_STATE=0
9+
MAX_AUTO_RETRY=5
910

1011
log () {
1112
echo -e "\n$1"
1213
}
1314

1415
# inspired by https://unix.stackexchange.com/a/82602
15-
MAX_AUTO_RETRY=1
1616
retry () {
1717
local n=1
1818

@@ -54,7 +54,6 @@ case $1 in
5454
set_tz
5555

5656
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --tag=gl | circleci tests split))
57-
MAX_AUTO_RETRY=2
5857
for s in ${SHARDS[@]}; do
5958
retry npm run test-jasmine -- "$s" --tags=gl --skip-tags=noCI --showSkipped
6059
done
@@ -65,8 +64,8 @@ case $1 in
6564
jasmine3)
6665
set_tz
6766

68-
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --tag=flaky | circleci tests split))
69-
MAX_AUTO_RETRY=4
67+
SHARDS=($(node $ROOT/tasks/shard_jasmine_tests.js --limit=1 --tag=flaky | circleci tests split))
68+
7069
for s in ${SHARDS[@]}; do
7170
retry npm run test-jasmine -- "$s" --tags=flaky --skip-tags=noCI --showSkipped
7271
done

tasks/shard_jasmine_tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var argv = minimist(process.argv.slice(2), {
1515
limit: ['l'],
1616
},
1717
default: {
18-
limit: 1
18+
limit: 20
1919
}
2020
});
2121

test/jasmine/tests/gl2d_plot_interact_test.js

+21-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,11 @@ function countCanvases() {
2020
return d3.selectAll('canvas').size();
2121
}
2222

23-
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
24-
2523
describe('Test removal of gl contexts', function() {
2624
var gd;
2725

2826
beforeEach(function() {
27+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
2928
gd = createGraphDiv();
3029
});
3130

@@ -98,6 +97,7 @@ describe('Test gl plot side effects', function() {
9897
var gd;
9998

10099
beforeEach(function() {
100+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
101101
gd = createGraphDiv();
102102
});
103103

@@ -320,6 +320,7 @@ describe('Test gl2d plots', function() {
320320
var mock = require('@mocks/gl2d_10.json');
321321

322322
beforeEach(function() {
323+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
323324
gd = createGraphDiv();
324325
});
325326

@@ -1274,9 +1275,19 @@ describe('Test gl2d plots', function() {
12741275
});
12751276

12761277
describe('Test scattergl autorange:', function() {
1277-
afterEach(destroyGraphDiv);
1278-
12791278
describe('should return the same value as SVG scatter for ~small~ data', function() {
1279+
var gd;
1280+
1281+
beforeEach(function() {
1282+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
1283+
gd = createGraphDiv();
1284+
});
1285+
1286+
afterEach(function() {
1287+
Plotly.purge(gd);
1288+
destroyGraphDiv();
1289+
});
1290+
12801291
var specs = [
12811292
{name: 'lines+markers', fig: require('@mocks/gl2d_10.json')},
12821293
{name: 'bubbles', fig: require('@mocks/gl2d_12.json')},
@@ -1287,7 +1298,6 @@ describe('Test scattergl autorange:', function() {
12871298

12881299
specs.forEach(function(s) {
12891300
it('@gl - case ' + s.name, function(done) {
1290-
var gd = createGraphDiv();
12911301
var glRangeX;
12921302
var glRangeY;
12931303

@@ -1320,6 +1330,7 @@ describe('Test scattergl autorange:', function() {
13201330
var gd;
13211331

13221332
beforeEach(function() {
1333+
jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
13231334
gd = createGraphDiv();
13241335
// to avoid expansive draw calls (which could be problematic on CI)
13251336
spyOn(ScatterGl, 'plot').and.callFake(function(gd) {
@@ -1328,6 +1339,11 @@ describe('Test scattergl autorange:', function() {
13281339
});
13291340
});
13301341

1342+
afterEach(function() {
1343+
Plotly.purge(gd);
1344+
destroyGraphDiv();
1345+
});
1346+
13311347
// threshold for 'fast' axis expansion routine
13321348
var N = 1e5;
13331349
var x = new Array(N);

0 commit comments

Comments
 (0)