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

Load stock_items with a deterministic order in OrderInventory#determine_target_shipment #5288

Merged
merged 2 commits into from
Aug 7, 2023

Conversation

elia
Copy link
Member

@elia elia commented Jul 27, 2023

Summary

Ensure stock_items are loaded in a deterministic order inside determine_target_shipment.

I couldn't recreate the error, but the spec is now more reliable and should give better hints on what went wrong.

Checklist

Check out our PR guidelines for more details.

The following are mandatory for all PRs:

The following are not always needed:

  • 📖 I have updated the README to account for my changes.
  • 📑 I have documented new code with YARD.
  • 🛣️ I have opened a PR to update the guides.
  • ✅ I have added automated tests to cover my changes.
  • 📸 I have attached screenshots to demo visual changes.

@elia elia self-assigned this Jul 27, 2023
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Jul 27, 2023
@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #5288 (581d2eb) into main (834347e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #5288   +/-   ##
=======================================
  Coverage   88.70%   88.70%           
=======================================
  Files         563      563           
  Lines       13889    13890    +1     
=======================================
+ Hits        12320    12321    +1     
  Misses       1569     1569           
Files Changed Coverage Δ
core/app/models/spree/order_inventory.rb 98.41% <100.00%> (+0.02%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@elia elia force-pushed the elia/stock-items-order branch 2 times, most recently from b73b71e to f71fb8b Compare July 27, 2023 15:31
@elia elia marked this pull request as ready for review August 1, 2023 12:18
@elia elia requested a review from a team as a code owner August 1, 2023 12:18
@elia elia requested a review from spaghetticode August 1, 2023 12:19
Ensure stock_items are loaded in a deterministic order inside `determine_target_shipment`
and in the spec.
- Explicitly set the count on hand
- Add pre-flight expectations
- Aggregate failures

The flakeyness is very hard to reproduce and if the supposed fixes
won't have an effect at least this should give use more information
on why it failed.
@elia elia requested a review from jarednorman August 1, 2023 14:05
@waiting-for-dev waiting-for-dev merged commit 4786fc4 into main Aug 7, 2023
11 checks passed
@waiting-for-dev waiting-for-dev deleted the elia/stock-items-order branch August 7, 2023 09:23
@elia elia changed the title Fix random failures in #determine_target_shipment Load stock_items with a deterministic order in OrderInventory#determine_target_shipment Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:solidus_core Changes to the solidus_core gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants