Skip to content

Fix flaky specs #6197

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

Merged
merged 8 commits into from
Mar 27, 2025
Merged

Fix flaky specs #6197

merged 8 commits into from
Mar 27, 2025

Conversation

mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Mar 27, 2025

Summary

We're experiencing another wave of flaky specs, most likely because chrome or Selenium have become faster. These changes make our test suite wait in appropriate places and stop testing Rails behaviour that we don't need to test.

Checklist

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.

@mamhoff mamhoff requested a review from a team as a code owner March 27, 2025 15:21
@github-actions github-actions bot added changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem changelog:solidus_promotions Changes to the solidus_promotions gem labels Mar 27, 2025
@mamhoff mamhoff force-pushed the fix-flaky-specs branch 2 times, most recently from 5e87b17 to 6694683 Compare March 27, 2025 16:13
mamhoff added 7 commits March 27, 2025 17:26
The "spec_helper" does not include all the features necessary for
feature specs.
We can't be sure the action has been created without having had
confirmation on the screen.
We need to make sure that the browser has updated the page contents
before checking for the updated path.
Otherwise, `Spree::Image.first` might not have its attachment yet.
Otherwise, the current path might not be what we expect yet.
Otherwise, the benefit might not have updated in the database yet.
We can just test that the buttons have the necessary attribute for the
behaviour.

These tests had become flaky.
This should help fix some really ugly flaky test runs.

See teamcapybara/capybara#2800 for context.
Copy link

codecov bot commented Mar 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.81%. Comparing base (0fea9df) to head (59daea8).
Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6197      +/-   ##
==========================================
+ Coverage   85.72%   88.81%   +3.09%     
==========================================
  Files         444      836     +392     
  Lines       10087    18164    +8077     
==========================================
+ Hits         8647    16133    +7486     
- Misses       1440     2031     +591     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

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

Bless you 🙏🏻

@tvdeyen
Copy link
Member

tvdeyen commented Mar 27, 2025

re-ran specs. just out of curiosity

@tvdeyen tvdeyen enabled auto-merge March 27, 2025 17:32
@tvdeyen tvdeyen added backport-v4.4 Backport this pull-request to v4.4 backport-v4.5 Backport this pull-request to v4.5 labels Mar 27, 2025
@tvdeyen tvdeyen merged commit 36c2646 into solidusio:main Mar 27, 2025
25 of 27 checks passed
@github-actions github-actions bot mentioned this pull request Mar 27, 2025
Copy link

💔 Some backports could not be created

Status Branch Result
v4.4 Backport failed because of merge conflicts
v4.5

Manual backport

To create the backport manually run:

backport --pr 6197

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v4.4 Backport this pull-request to v4.4 backport-v4.5 Backport this pull-request to v4.5 changelog:solidus_admin changelog:solidus_backend Changes to the solidus_backend gem changelog:solidus_legacy_promotions Changes to the solidus_legacy_promotions gem changelog:solidus_promotions Changes to the solidus_promotions gem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants