Skip to content

Rearrange jasmine test retries #3667

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 9 commits into from
Apr 1, 2019
Merged

Conversation

archmoj
Copy link
Contributor

@archmoj archmoj commented Mar 23, 2019

A follow up of #3661 and #3599 in order to have more robust jasmine tests with less retries

  • set shards limit of non-@gl tests to 1 which helped fix various side effects between different tests
  • removed noCI tags from a number of tests such as gl2d lasso/select & parcoods.
  • adjusted timeouts of some tests to run on CI
    @plotly/plotly_js

reduced number of retries for jasmine-2
reduced number of retries for jasmine-3
adjusted timeouts to help fix test errors on CI
removed noCI tags from a number of tests
set shards limit to 1 - fixed various side effects between different tests

reduce n it limit to reduce side effects between different tests

now we can reduce retries for both

now test if we could remove some noCI flags from the tests

reset few noCI flags

final considerations
reset timeout and reduced delays
set gl retry to 3
@@ -15,7 +15,7 @@ var argv = minimist(process.argv.slice(2), {
limit: ['l'],
},
default: {
limit: 20
limit: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

So each test suite is runned separately?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. That's exactly what I wanted there for gl and flaky. I noticed e.g. setting timeout in one suite may have an effect on another suite. After having this in place the tests started to pass properly.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you leave to default to 20 and pass a --limit 1 in the relevant test commands in .circleci/test.sh.

Do all npm run test-jasmine commands need to have --limit 1?

@etpinard
Copy link
Contributor

@archmoj I'm a little puzzled by this PR. If it makes our tests on CI less flaky than great, but I'd like to why and how much less flaky they get.

  • applied different retry numbers for gl and flaky containers
    reduced number of retries for jasmine-2 test
    reduced number of retries for jasmine-3 test

Why does this help?

  • set shards limit to 1 i.e. helped fix various side effects between different tests

That sounds like an overkill to me. For example, if our tests are less flaky, but take 5x longer to run, this won't help us much. So yeah I'm asking you: after say CI 20 runs, are our tests 2x, 5x, 10x less flaky? How much slower are they?

  • removed noCI tags from a number of tests such as gl2d lasso/select & parcoods.

🎉 nice!

  • adjusted timeouts of some tests to run on CI
    @plotly/plotly_js

👌


All in all, #3634 sounds more promising. It might be a good idea to wait until @antoinerg is done with that one before spending more time trying to monkey-patch our tests.

@archmoj
Copy link
Contributor Author

archmoj commented Mar 29, 2019

@etpinard it seems more flaky tests are passing in the first run. The timing are not too bad. And now with @antoinerg great PR #3634 being merged we have:
Screenshot from 2019-03-28 22-59-33

@etpinard
Copy link
Contributor

it seems more flaky tests are passing in the first run

Cool. Can you re-run the tests 10 times and see what's the success rate?

archmoj added 3 commits March 29, 2019 16:39
…lly and on the CI

set timeout for the rest of the tests in one suite
added one noCI flag to the sankey test which is failing on the CI and even locally with flaky flag
set flaky retry to 5 now that it runs fast
@archmoj
Copy link
Contributor Author

archmoj commented Apr 1, 2019

After 10 runs the success rate seems to be around 80 percent i.e. including no flaky suite fails.
https://circleci.com/gh/plotly/workflows/plotly.js/tree/reduce-num-retries-in-jasmine
Screenshot from 2019-04-01 12-54-30

@etpinard
Copy link
Contributor

etpinard commented Apr 1, 2019

After 10 runs the success rate seems to be around 80 percent

Is that better than on master?

@@ -20,6 +20,8 @@ function countCanvases() {
return d3.selectAll('canvas').size();
}

jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000;
Copy link
Contributor

@etpinard etpinard Apr 1, 2019

Choose a reason for hiding this comment

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

Does this apply only to this test suite or to all test suites that get bundled?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. I noticed when using shard with high limit number (e.g. 20), changing a timout in one test has an impact on the other tests in another suites. That may be one reason to try to keep them separated. Anyway a better solution may be to have a timeout setup for every suite/describe block to avoid side effects?

Copy link
Contributor

Choose a reason for hiding this comment

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

Anyway a better solution may be to have a timeout setup for every suite/describe block to avoid side effects?

Yes, that's a better solution.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@etpinard @antoinerg Any default value there to start with? Should they be set for every describe block? Or having them in every suites is only required?


log () {
echo -e "\n$1"
}

# inspired by https://unix.stackexchange.com/a/82602
MAX_AUTO_RETRY=1
Copy link
Contributor

Choose a reason for hiding this comment

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

Why would we want to lower MAX_AUTO_RETRY?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks flaky tests (jasmine3) sometime required more retries. The gl tests on the other hand are slow and may not need that number of retries. Specially if they fail for a good reason, we don't want to wait too long to be notified that the test is actually failed.

Copy link
Contributor

Choose a reason for hiding this comment

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

The gl tests on the other hand are slow and may not need that number of retries.

Well, I suspect the gl tests are slow (now) because you reduced the number of test per shards to 1.

To me, having MAX_AUTO_RETRY=5 for all retry loops is the best of both world. Sufficient retry attempt, but failing runs that take to long to exit.

@archmoj
Copy link
Contributor Author

archmoj commented Apr 1, 2019

After 10 runs the success rate seems to be around 80 percent

Is that better than on master?

Always hard to tell which one is better. On this branch less noCI flags are applied with less retries. I hope that less is more and that we can have even more robust tests.

@etpinard
Copy link
Contributor

etpinard commented Apr 1, 2019

On this branch less noCI flags are applied with less retries

I agree, there's a lot of good on this branch, no doubt.

Here are my recommendations (to get this thing merged):

  • Bring back MAX_AUTO_RETRY=5 for all retry loops
  • Bring back the limit: 20 default in the shard utility
  • Lower the shard limit for the non-@gl test-jasmine commands
  • Bump the timeout in gl2d_plot_interact_test.js per it block as opposed to that jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; line in the file scope

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
@archmoj
Copy link
Contributor Author

archmoj commented Apr 1, 2019

I agree, there's a lot of good on this branch, no doubt.

Here are my recommendations (to get this thing merged):

  • Bring back MAX_AUTO_RETRY=5 for all retry loops
  • Bring back the limit: 20 default in the shard utility
  • Lower the shard limit for the non-@gl test-jasmine commands
  • Bump the timeout in gl2d_plot_interact_test.js per it block as opposed to that jasmine.DEFAULT_TIMEOUT_INTERVAL = 5000; line in the file scope

@etpinard Thanks for the recommendations.
Applied in 24aafc8.

@etpinard
Copy link
Contributor

etpinard commented Apr 1, 2019

Ok, let's get this in 💃

@archmoj archmoj merged commit c657348 into master Apr 1, 2019
@archmoj archmoj deleted the reduce-num-retries-in-jasmine branch April 1, 2019 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants