rubyforgood / human-essentials

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
https://humanessentials.app
MIT License
429 stars 445 forks source link

[BUG]: flaky `distributions_by_county_system_spec` #4338

Closed elasticspoon closed 2 weeks ago

elasticspoon commented 3 weeks ago

This test has order dependent failures on main.

https://github.com/rubyforgood/human-essentials/actions/runs/8962284988/job/24610951378

Minimal reproduction command:

  rspec ./spec/requests/account_requests_spec.rb[1:2:3:1,1:3:3:1] ./spec/requests/attachments_requests_spec.rb[1:1:1] ./spec/requests/distributions_requests_spec.rb[1:1:1:1,1:1:2:1,1:1:2:2:1,1:1:3:1,1:1:4:1,1:1:4:2,1:1:4:3,1:1:4:4:1,1:1:5:1,1:1:5:2,1:1:6:1,1:1:6:2:1,1:1:6:3:1,1:1:7:1,1:1:7:2,1:1:7:3:1,1:1:8:1,1:1:9:1:1,1:1:9:1:2,1:1:10:1,1:1:10:2,1:1:10:3,1:1:11:1,1:1:12:1,1:1:12:2:1,1:1:12:2:2,1:1:12:3:1,1:1:12:3:2:1,1:1:12:3:3:1,1:1:13:1,1:1:13:2,1:1:13:3,1:2:1,1:2:2:1:1] ./spec/requests/users_requests_spec.rb[1:1:1,1:2:1,1:3:1,1:3:2,1:3:3,1:3:4,1:4:1:1,1:4:1:2,1:4:2:1] ./spec/system/distributions_by_county_system_spec.rb[1:1:1,1:1:2] ./spec/system/request_system_spec.rb[1:1:1,1:1:2] --seed 48062

Okay, I lied its not the minimal one but I ran it for like 20 mins and had to leave :slightly_frowning_face:

Is there an existing issue for this?

Code of Conduct

cielf commented 3 weeks ago

It looks like it's looking for a certain number of "50"s , but the bank name that has been created for this test, with this particular seed has a 50 in the name of it.

cielf commented 3 weeks ago

If that's the case, I would expect the following test to also have a seed for which it does not work. Also any other tests where we are counting the occurances of a relatively low integer where a name with a sequence number in it would appear.

cielf commented 2 weeks ago

Yup -- confirmed that that has also happened.

cielf commented 2 weeks ago

@elasticspoon : Therefore I think specifying a name for the organization in distribution_by_county_shared_example.rb might do the trick.

elasticspoon commented 2 weeks ago

@cielf you are right. good catch