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 specs: Localization Changing the locale and Available locales appear in the locale switcher #1630

Closed
2 of 3 tasks
javierm opened this issue Sep 10, 2018 · 0 comments · Fixed by consuldemocracy/consuldemocracy#3096
Assignees

Comments

@javierm
Copy link

javierm commented Sep 10, 2018

What

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

Travis failed build: https://travis-ci.org/consul/consul/jobs/425725629 Not available anymore.

To reproduce locally, run:

bin/rspec spec/customization_engine_spec.rb:19 spec/features/localization_spec.rb:42 spec/features/localization_spec.rb:32 spec/features/localization_spec.rb:18 --seed 26791

Failure:

  1) Localization Changing the locale
     Failure/Error: select('Español', from: 'locale-switcher')
     
     Capybara::ElementNotFound:
       Unable to find visible option "Español" within #<Capybara::Node::Element tag="select" path="/html/body/div[1]/header/div[1]/div/div[1]/form/select">
     # ./spec/features/localization_spec.rb:36:in `block (2 levels) in <top (required)>'

  2) Localization Available locales appear in the locale switcher
     Failure/Error: expect(page).to have_content 'Español'
       expected to find text "Español" in "English translation missing: es.locale translation missing: fr.locale English translation missing: pt-BR.locale translation missing: val.locale How to help"
     # ./spec/features/localization_spec.rb:22:in `block (3 levels) in <top (required)>'
     # ./spec/features/localization_spec.rb:21:in `block (2 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

Notes

These failures seem to be related to the way the first test excecutes I18n.load_path = path; I18n.reload! and the second one stubs I18n.available_locales. Those two things combined make the other tests fail because they cause I18n.t("locale", locale: :es) to return "translation missing: es.locale".

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

Successfully merging a pull request may close this issue.

1 participant