-
-
Notifications
You must be signed in to change notification settings - Fork 503
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
Fix distribution flaky test #4248
Comments
Hi @dorner, I think that is also related with the failing test that I've been getting on my PR. Locally, I could't replicate the error that you described even using the same seed and executing with: bundle exec rspec --format documentation --format KnapsackPro::Formatters::TimeTracker --seed 49610 --default-path spec "spec/requests/admin/barcode_items_requests_spec.rb" "spec/requests/admin/users_requests_spec.rb" "spec/requests/dashboard_requests_spec.rb" "spec/requests/item_categories_requests_spec.rb" "spec/requests/partners/distributions_spec.rb" "spec/requests/partners/requests_spec.rb" "spec/requests/purchases_requests_spec.rb" "spec/requests/transfers_requests_spec.rb" "spec/system/adjustment_system_spec.rb" "spec/system/admin/users_system_spec.rb" "spec/system/distribution_system_spec.rb" "spec/system/layout_system_spec.rb" "spec/system/partner_system_spec.rb" "spec/system/partners/partner_distribution_system_spec.rb" "spec/system/question_system_spec.rb" However, when running it multiple times with random seeds, I encountered a similar error in another test:
Here you can see another flaky failure within the same batch of tests that occurred in the CI environment:
Should I focus solely on addressing these selection failures, or should I also investigate the issue with the downloaded CSV? |
Maybe make a separate GitHub issue for the CSV problem? Let's not require both to be fixed for this issue to be addressed. |
I am not sure about the fix but I am pretty sure the problem is: select @partner.name, from: "Partner"
select @storage_location.name, from: "From storage location"
select item.name, from: "distribution_line_items_attributes_0_item_id"
select @storage_location.name, from: "distribution_storage_location_id"
fill_in "distribution_line_items_attributes_0_quantity", with: 18 When the page loads the select box I am guessing in CI the AJAX request is slow from time to time and by the time it tries to do I think the solution is to somehow wait for that select to get populated, but off the top of my head I don't know the best approach. I am also unsure how to set up Capybara in such a way that is throttled to try and replicate the issue. But I think what I wrote is the crux of the issue. |
You can tell Capybara to wait for a particular CSS or XPath selector to resolve to something. So as long as you can describe what you're actually looking for using one of those two styles, you should be OK. |
Summary
This fails randomly but fairly often:
Things to consider
More info for this particular run:
Criteria for Completion
The text was updated successfully, but these errors were encountered: