openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.12k stars 724 forks source link

[Flaky] rspec ./spec/controllers/admin/bulk_line_items_controller_spec.rb:55 #11016

Open filipefurtad0 opened 1 year ago

filipefurtad0 commented 1 year ago

What we should change and why (this is tech debt)

Failures:

  1) Admin::BulkLineItemsController#index as an administrator when no ransack params are passed in sorts line_items in ascending id line_item
     Failure/Error: expect(line_item_ids[0]).to be < line_item_ids[1]

       expected: < 102
            got:   105
     # ./spec/controllers/admin/bulk_line_items_controller_spec.rb:56:in `block (5 levels) in <top (required)>'

Finished in 2 minutes 4 seconds (files took 9.12 seconds to load)
109 examples, 1 failure

Failed examples:

rspec ./spec/controllers/admin/bulk_line_items_controller_spec.rb:55 # Admin::BulkLineItemsController#index as an administrator when no ransack params are passed in sorts line_items in ascending id line_item

Context

https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/5275378952/jobs/9543514824?pr=10704

Impact and timeline

filipefurtad0 commented 1 year ago

I can reproduce it locally, I must say it has a the weird behavior of failing in "blocks", like so:

Pass.
Pass.
Pass.
Pass.
Pass.
Pass.
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
Pass.
Pass.
Pass.
Pass.
Pass.
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
    !!! Fail !!!
Pass.
Pass.
Pass.
Pass.
Pass.

I wonder if this relates to the CPU performance somehow...