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: bot_user_agent on test_faker_internet.rb #2521

Closed
Tracked by #2522
thdaraujo opened this issue Aug 8, 2022 · 2 comments · Fixed by #2530
Closed
Tracked by #2522

Fix flaky test: bot_user_agent on test_faker_internet.rb #2521

thdaraujo opened this issue Aug 8, 2022 · 2 comments · Fixed by #2530

Comments

@thdaraujo
Copy link
Contributor

thdaraujo commented Aug 8, 2022

Describe the problem

Looks like there are some flaky test on test_faker_internet.rb related to bot_user_agent generation.

It raises these types of errors:

Failure: test_bot_user_agent_with_invalid_argument(TestFakerInternet): <nil> is not true.
/home/runner/work/faker/faker/test/faker/default/test_faker_internet.rb:382:in `test_bot_user_agent_with_invalid_argument'
     379: 
     380:   def test_bot_user_agent_with_invalid_argument
     381:     assert @tester.bot_user_agent(vendor: :ie).match(/Baiduspider|Bot|bot/)
  => 382:     assert @tester.bot_user_agent(vendor: nil).match(/Baiduspider|Bot|bot/)
     383:     assert @tester.bot_user_agent(vendor: 1).match(/Baiduspider|Bot|bot/)
     384:   end
     385: 

And:

Failure: test_bot_user_agent_with_no_argument(TestFakerInternet): <nil> is not true.
/home/runner/work/faker/faker/test/faker/default/test_faker_internet.rb:342:in `test_bot_user_agent_with_no_argument'
     339:   end
     340: 
     341:   def test_bot_user_agent_with_no_argument
  => 342:     assert @tester.bot_user_agent.match(/Baiduspider|Bot|bot/)
     343:   end
     344: 
     345:   def test_bot_user_agent_with_valid_argument

To Reproduce

Run the CI (see example):

Expected behavior

The test should always pass or it should be removed.

@yagosansz
Copy link

Hi @thdaraujo, could you please assign the issue to me? I'd like to give it a try 😄

@thdaraujo
Copy link
Contributor Author

Hi @thdaraujo, could you please assign the issue to me? I'd like to give it a try smile

hey @yagosansz thanks for the interest! But I already had a PR up for this issue 😅

Take a look at the other open issues, I'm sure you'll find something interesting to work on. Let me know so I can assign you other issue. :)

@thdaraujo thdaraujo self-assigned this Aug 10, 2022
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.

2 participants