-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Remove call to non-existent method & fix system tests #2247
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (doesn't raise exception in the web console)
This PR is failing again and again and again on system tests. I'm not sure what to do with it! It's failing different ones each time which makes no sense to me. It passed after 7 tries before. Does data persist between system test runs? Is it something to do with the order they're running in? |
To answer your question: no data should not be shared / cached between runs, all it is doing is spinning up the rails server, starting a browser and poking things in the browser. I think flaky integration tests are just a hazard as they are reliant on the performance of the CI server running the code (because the browser has no "direct" link to the app server running our code). Digging in it looks like Looks like wait is set to rendered = find(:css, '.select2-selection__rendered', wait: 30).text.delete('×').delete("\n") |
hmmm I'm not sure - it's failed for lots of different reasons - that's just the reason it failed this time around. Good to know it's not an order thing though. I know the tests are flaky but I think this latest fail is at least number 10, out of 11 runs - that feels like more than just bad luck? This PR is datatable related and there is lots of datatable related interaction in the system tests so could it be something related to that? |
A useful rake task for batch running system tests and reporting results
|
Fixes #1754
Fixes #2116
Description
Originally this PR just updated a line with a call that will destroy the table, following the datatables documentation https://datatables.net/reference/option/destroy. Updating this flagged up an area of our tests that are really unreliable - system tests. I wrote a rake task to allow me to run tests multiple times locally and log the number of failures, as I tried tinkering with the wait times in our helpers. The results of this were:
Just increasing the time we wait for things to happenI looked through the test failures and found that most of the fails were due to not finding a datatable element on the calendar (possibly something introduced in this PR given the frequency of the failures) or elements going stale. I've added two new helper methods to catch these exceptions and retry when they happen, to try to prevent tests failing as often as they are. Where an action is being repeated I have reduced the wait times slightly. The helpers will retry up to 5 times, which is hopefully enough to evade flakiness but still finish in a timely manner if something is genuinely broken.
I'll add the code I used for the rake task in as a comment - don't want to commit it and clog up the repo but it was useful!