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 #2772

Closed
thdaraujo opened this issue May 31, 2023 · 2 comments
Closed

Flaky specs #2772

thdaraujo opened this issue May 31, 2023 · 2 comments

Comments

@thdaraujo
Copy link
Contributor

thdaraujo commented May 31, 2023

Describe the bug

We have some flaky specs at the moment, and it would be nice if we could get them fixed. 🙏

assert_match(/^\d{9}$/, sample)

assert_match(/(\w+\.? ?){3,4}/, @tester.first_name)

To Reproduce

Run CI, or look at this previous failed run:
https://github.com/faker-ruby/faker/actions/runs/5124077333/jobs/9223275835#step:6:45

Expected behavior

No flaky tests!

Additional context

Here's an example:

===============================================================================
Failure: test_brazilian_id(TestFakerIdNumber):
  </^\d{9}$/> was expected to be =~
  <"43[6](https://github.com/faker-ruby/faker/actions/runs/5124077333/jobs/9225159454?pr=2761#step:6:7)[7](https://github.com/faker-ruby/faker/actions/runs/5124077333/jobs/9225159454?pr=2761#step:6:8)[8](https://github.com/faker-ruby/faker/actions/runs/5124077333/jobs/9225159454?pr=2761#step:6:9)337X">.
/home/runner/work/faker/faker/test/faker/default/test_faker_id_number.rb:89:in `test_brazilian_id'
     86:   def test_brazilian_id
     87:     sample = @tester.brazilian_id
     88: 
  => 8[9](https://github.com/faker-ruby/faker/actions/runs/5124077333/jobs/9225159454?pr=2761#step:6:10):     assert_match(/^\d{9}$/, sample)
     90:     assert_match(/(\d)((?!\1)\d)+/, sample)
     91:   end
     92: 
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/2.7.0/rubygems/deprecate.rb:63: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/runner/work/faker/faker/lib/faker/default/internet.rb:63: warning: The called method `_deprecated_free_email' is defined here
/opt/hostedtoolcache/Ruby/2.7.8/x64/lib/ruby/2.7.0/rubygems/deprecate.rb:63: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
/home/runner/work/faker/faker/lib/faker/default/internet.rb:81: warning: The called method `_deprecated_safe_email' is defined here

And:

===============================================================================
Failure: test_first_name(TestFakerName):
  </(\w+\.? ?){3,4}/> was expected to be =~
  <"Ta">.
/home/runner/work/faker/faker/test/faker/default/test_faker_name.rb:19:in `test_first_name'
     16:   end
     17: 
     18:   def test_first_name
  => 19:     assert_match(/(\w+\.? ?){3,4}/, @tester.first_name)
     20:   end
     21: 
     [22](https://github.com/faker-ruby/faker/actions/runs/5124077333/jobs/9225334328?pr=2761#step:6:23):   def test_male_first_name
==================================================
@sarvesh-sankaranarayanan

Working on this.

ruban-thilak added a commit to ruban-thilak/faker that referenced this issue Jun 18, 2023
@ruban-thilak
Copy link
Contributor

Can we please close this issue, since it's fixed.

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