Skip to content

Auto-retry jasmine test on CI #2373

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .circleci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,37 @@ set +e
set +o pipefail

EXIT_STATE=0
MAX_AUTO_RETRY=5

# inspired by https://unix.stackexchange.com/a/82602
retry () {
local n=0

until [ $n -ge $MAX_AUTO_RETRY ]; do
"$@" && break
n=$[$n+1]
echo ''
echo run $n of $MAX_AUTO_RETRY failed, trying again ...
echo ''
sleep 15
done

if [ $n -eq $MAX_AUTO_RETRY ]; then
EXIT_STATE=1
fi
}

case $1 in

jasmine)
npm run test-jasmine -- --skip-tags=gl,noCI || EXIT_STATE=$?
npm run test-jasmine -- --skip-tags=gl,noCI,flaky || EXIT_STATE=$?
exit $EXIT_STATE
;;

jasmine2)
npm run test-jasmine -- --tags=gl --skip-tags=noCI || EXIT_STATE=$?
npm run test-bundle || EXIT_STATE=$?
npm run test-jasmine -- --tags=gl --skip-tags=noCI,flaky || EXIT_STATE=$?
retry npm run test-jasmine -- --tags=flaky --skip-tags=noCI
npm run test-bundle || EXIT_STATE=$?
exit $EXIT_STATE
;;

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/animate_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ describe('Animating multiple axes', function() {
destroyGraphDiv();
});

it('updates ranges of secondary axes', function(done) {
it('@flaky updates ranges of secondary axes', function(done) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you think of any other flaky tests worth adding to the list @alexcjohnson ?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, I think you got the most common ones, but now it's super easy to add @flaky if another test fails spuriously. Lets just keep an eye out for failures over the next few days after merging this.

Plotly.plot(gd, [
{y: [1, 2, 3]},
{y: [1, 2, 3], yaxis: 'y2'}
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/gl2d_plot_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ describe('@gl Test gl2d plots', function() {
});
}

it('should respond to drag interactions', function(done) {
it('@flaky should respond to drag interactions', function(done) {
var _mock = Lib.extendDeep({}, mock);

var relayoutCallback = jasmine.createSpy('relayoutCallback');
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/parcoords_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ describe('@gl parcoords', function() {

});

it('Calling `Plotly.animate` with patches targeting `dimensions` attributes should do the right thing', function(done) {
it('@flaky Calling `Plotly.animate` with patches targeting `dimensions` attributes should do the right thing', function(done) {
Plotly.newPlot(gd, [{
type: 'parcoords',
line: {color: 'blue'},
Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/select_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ var BOXEVENTS = [1, 2, 1];
// assumes 5 points in the lasso path
var LASSOEVENTS = [4, 2, 1];

describe('Test select box and lasso in general:', function() {
describe('@flaky Test select box and lasso in general:', function() {
var mock = require('@mocks/14.json');
var selectPath = [[93, 193], [143, 193]];
var lassoPath = [[316, 171], [318, 239], [335, 243], [328, 169]];
Expand Down