Skip to content
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

Flaky spec: Residence Assigned officers Error on verify Unable to find visible button "Validate document" #1211

Closed
3 tasks
bertocq opened this issue Feb 5, 2018 · 4 comments

Comments

@bertocq
Copy link

bertocq commented Feb 5, 2018

What

Tests that fail randomly are called "flakies", this one seems to be one:

Randomized seed: 63774

Failure:

    5) Residence Assigned officers Error on verify
     Failure/Error: click_button 'Validate document'
     Capybara::ElementNotFound:
       Unable to find visible button "Validate document"
     # ./spec/features/officing/residence_spec.rb:70:in `block (3 levels) in <top (required)>'

How

  • Explain why the test is flaky, or under which conditions/scenario it fails randomly
  • Explain why your PR fixes it
  • Create a backport PR to consul/consul when the fixing PR is approved

Tips for flaky hunting

Random values issues

If the problem comes from randomly generated values, running multiple times a single spec could help you reproduce the failure by running at your command line:

for run in {1..10}
do
  bin/rspec ./spec/features/budgets/investments_spec.rb:256
done

You can also try running a single spec in Travis:
Add option :focus to the spec and push your branch to Github, for example:

scenario 'Show', :focus do

But remember to remove that :focus changes afterwards when submitting your PR changes!

Test order issues

Running specs in the order they failed may discover that the problem is that a previous test sets an state in the test environment that makes our flaky fail/pass. Tests should be independent from the rest.

After executing rspec you can see the seed used, add it as an option to rspec, for example:
bin/rspec --seed 55638 (check Randomized seed value at beginning of issue)

Other things to watch for

@vicentemendozam
Copy link

I'll take this one

@bertocq bertocq added this to Next in Roadmap Feb 6, 2018
@bertocq bertocq moved this from Next to Doing in Roadmap Feb 6, 2018
@bertocq bertocq moved this from Doing to Review in Roadmap Feb 7, 2018
@bertocq
Copy link
Author

bertocq commented Feb 7, 2018

Great @vicentemendozam 👏 lets hope not to see this one again :)

Please remember to do that backport PR so we can close this issue (and the refactor you mentioned that would be awesome too!!)

@bertocq bertocq moved this from Review to Doing in Roadmap Feb 7, 2018
@vicentemendozam
Copy link

I hope so! 👍
Yeah I'm doing the backport and the preventive fix ASAP

@bertocq
Copy link
Author

bertocq commented Feb 9, 2018

Nice @vicentemendozam !! 👏 backport ✅ and issue completed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants