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

Fix flaky test: test_stack on test_faker_computer.rb #2541

Closed
thdaraujo opened this issue Aug 26, 2022 · 0 comments · Fixed by #2543
Closed

Fix flaky test: test_stack on test_faker_computer.rb #2541

thdaraujo opened this issue Aug 26, 2022 · 0 comments · Fixed by #2543

Comments

@thdaraujo
Copy link
Contributor

thdaraujo commented Aug 26, 2022

It looks like the test below is flaky, and there is a comment on line 20 that needs to be removed:

It raises the error below when Faker::Computer.stack[:platform] is equal to plan 9.

===============================================================================
Error: test_stack(TestFakerComputer): I18n::MissingTranslationData: translation missing: en.faker.computer.os.plan 9
/opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/i18n-1.12.0/lib/i18n.rb:394:in `handle_exception'
/opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/i18n-1.12.0/lib/i18n.rb:367:in `translate_key'
/opt/hostedtoolcache/Ruby/2.5.9/x64/lib/ruby/gems/2.5.0/gems/i18n-1.12.0/lib/i18n.rb:222:in `translate'
/home/runner/work/faker/faker/lib/faker.rb:167:in `block in translate'
/home/runner/work/faker/faker/lib/faker.rb:259:in `disable_enforce_available_locales'
/home/runner/work/faker/faker/lib/faker.rb:166:in `rescue in translate'
/home/runner/work/faker/faker/lib/faker.rb:156:in `translate'
/home/runner/work/faker/faker/lib/faker.rb:103:in `fetch'
/home/runner/work/faker/faker/lib/faker/default/computer.rb:58:in `stack'
/home/runner/work/faker/faker/test/faker/default/test_faker_computer.rb:22:in `test_stack'
     19:   def test_stack
     20:     # puts @tester.stack
     21:     assert stack = @tester.stack
  => 22:                           .match(/\A(?<platform>(?:[[:alnum:]]+\s?){1,5}), (?<os>(?:[[:alnum:]]+-?.?\)?\(?\s?){1,5})\z/)
     23: 
     24:     platform = stack[:platform]
     25:     search_format_platform = platform.downcase
===============================================================================
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