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

Ensure target shipments are evaluated in order of creation (fix flakey) #4954

Conversation

elia
Copy link
Member

@elia elia commented Feb 23, 2023

Summary

This solves a long standing flakey spec which was uncovering an actual issue with the method being dependent on the implicit db order and how it returned records.

I have added :id to the sorting to disambiguate ordering of shipments were created quickly one after the other and ended up having the same creation date (e.g. in specs).

Adding .reverse after order.shipments.order(:created_at, :id) is consistently reproducing the failure.

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.

This solves a long standing flakey spec which was uncovering an actual
issue.
@elia elia self-assigned this Feb 23, 2023
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Feb 23, 2023
@elia elia requested a review from kennyadsl February 23, 2023 16:34
@elia elia marked this pull request as ready for review February 23, 2023 17:01
@elia elia requested a review from a team as a code owner February 23, 2023 17:01
Copy link
Contributor

@waiting-for-dev waiting-for-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the way to go! 🚀

Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Left a question, I hope we can merge this soon!

core/app/models/spree/order_inventory.rb Show resolved Hide resolved
@elia elia requested a review from kennyadsl March 2, 2023 11:44
@kennyadsl kennyadsl merged commit aa3063e into solidusio:master Mar 2, 2023
@kennyadsl kennyadsl deleted the elia/fix-order-inventory-determine-target-shipment branch March 2, 2023 15:12
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

3 participants