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

Update descend_by_popularity scope spec #4979

Merged
merged 1 commit into from
Mar 15, 2023

Conversation

kennyadsl
Copy link
Member

So that it doesn't depend on the line item quantity.

Closes #4977

Summary

The scope is not taking into account the line item quantity and was actually evaluating both line items with the same order. variant_1 was picked first only because it was created first.

In fact, switching the creating order of the two variants it was failing consistently.

The flaky was due to the fact that it's not guarantee that the databases will return the record in the order they are created, unless specified.

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.

@kennyadsl kennyadsl added the type:bug Error, flaw or fault label Mar 14, 2023
@kennyadsl kennyadsl self-assigned this Mar 14, 2023
@kennyadsl kennyadsl requested a review from a team as a code owner March 14, 2023 17:40
@github-actions github-actions bot added the changelog:solidus_core Changes to the solidus_core gem label Mar 14, 2023
so that it doesn't depend on the line item quantity.

The scope is not taking into account the line item quantity
and was actually evaluating both line items with the same
order. variant_1 was picked first only because it was
created first.

In fact, switching the creating order of the two variants
it was failing consistently.

The flaky was due to the fact that it's not guarantee that
the databases will return the record in the order they are
created, unless specified.
@kennyadsl kennyadsl force-pushed the kennyadsl/fix-4969-flaky-specs branch from 4f01e09 to cf30c6f Compare March 15, 2023 08:51
@kennyadsl kennyadsl merged commit 5525671 into solidusio:master Mar 15, 2023
@kennyadsl kennyadsl deleted the kennyadsl/fix-4969-flaky-specs branch March 15, 2023 13:16
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 type:bug Error, flaw or fault
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistent database behavior for descend_by_popularity scope
3 participants