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

Bug: Flaky Test with spec/models/case_contact_spec.rb:453 #5050

Closed
schoork opened this issue Jul 30, 2023 · 2 comments · Fixed by #5068
Closed

Bug: Flaky Test with spec/models/case_contact_spec.rb:453 #5050

schoork opened this issue Jul 30, 2023 · 2 comments · Fixed by #5068
Assignees
Labels
Help Wanted This is a special label that enables github to showcase issues that want help Type: Bug

Comments

@schoork
Copy link
Collaborator

schoork commented Jul 30, 2023

Flaky tests are defined as tests that return both passes and failures despite no changes to the code or the test itself
Fix the test so it runs consistently.

Environment

docker

Sample Error Output:

Failure/Error:
       expect(groups_with_types).to eql(
         {
           "Family" => ["Parent"],
           "Health" => ["Medical Professional", "Other Therapist"]
         }
       )

       expected: {"Family"=>["Parent"], "Health"=>["Medical Professional", "Other Therapist"]}
            got: {"Family"=>["Parent"], "Health"=>["Other Therapist", "Medical Professional"]}

       (compared using eql?)

       Diff:
       @@ -1,3 +1,3 @@
        "Family" => ["Parent"],
       -"Health" => ["Medical Professional", "Other Therapist"],
       +"Health" => ["Other Therapist", "Medical Professional"],
     # ./spec/models/case_contact_spec.rb:453:in `block (3 levels) in <top (required)>'
     # /usr/local/bundle/gems/webmock-3.18.1/lib/webmock/rspec.rb:37:in `block (2 levels) in <top (required)>'

How to Replicate

Try running the test lots of times locally
bundle exec rspec spec/models/case_contact_spec.rb:453

Ran fine locally, failed in CI.

Looks like the expected vs. got was just a different order in the array.

Questions? Join Slack!

We highly recommend that you join us in slack https://rubyforgood.herokuapp.com/ #casa channel to ask questions quickly and hear about office hours (currently Tuesday 5-7pm Pacific), stakeholder news, and upcoming new issues.

@schoork schoork added Type: Bug Help Wanted This is a special label that enables github to showcase issues that want help labels Jul 30, 2023
@schoork
Copy link
Collaborator Author

schoork commented Jul 30, 2023

Absolutely! I will assign you to it.

@Br0k3nh4nd012
Copy link
Contributor

Br0k3nh4nd012 commented Jul 30, 2023

Hey @schoork, sorry for the confusion. I have commented from my different GitHub account previously.
Could you please assign it to this account?
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted This is a special label that enables github to showcase issues that want help Type: Bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants