Describe the bug
While running the test suite, there are some flaky tests with the comments shared example. I've seen it on Accountability and Budgets at least.
To Reproduce
Steps to reproduce the behavior:
- Run multiple times the spec for this file
for i in $(seq 1 20); do bin/rspec 'decidim-accountability/spec/system/comments_spec.rb[1:5:4:1]' || break ; done
Expected behavior
That this spec should run green all the time
Screenshots

Stacktrace
Randomized with seed 45779
F
Failures:
1) Accountability result comments when authenticated when user adds a new comment shows comment to the user, updates the comments counter and clears the comment textarea
Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure }
expected to find visible css "span.comments-count" with text "4 COMMENTS" but there were no matches. Also found "3 COMMENTS", which matched the selector but not all filters.
[Screenshot Image]: file:///home/apereira/Work/decidim/decidim/spec/decidim_dummy_app/tmp/screenshots/failures_r_spec_example_groups_accountability_result_comments_when_authenticated_when_user_adds_a_new_comment_shows_comment_to_the_user__updates_the_comments_counter_and_clears_the_comment_textarea_673.png
[Screenshot HTML]: file:///home/apereira/Work/decidim/decidim/spec/decidim_dummy_app/tmp/screenshots/failures_r_spec_example_groups_accountability_result_comments_when_authenticated_when_user_adds_a_new_comment_shows_comment_to_the_user__updates_the_comments_counter_and_clears_the_comment_textarea_673.html
Shared Example Group: "comments" called from ./spec/system/comments_spec.rb:11
# /home/apereira/Work/decidim/decidim/decidim-core/lib/decidim/core/test/shared_examples/comments_examples.rb:378:in `block (4 levels) in <top (required)>'
Finished in 16.16 seconds (files took 5.33 seconds to load)
1 example, 1 failure
Failed examples:
rspec ./spec/system/comments_spec.rb[1:5:4:1] # Accountability result comments when authenticated when user adds a new comment shows comment to the user, updates the comments counter and clears the comment textarea
Randomized with seed 45779
Extra data (please complete the following information):
- Decidim Version: 0.28.0.dev
- Decidim installation: CI and local
Additional context
https://github.com/decidim/decidim/runs/7070353790?check_suite_focus=true
Describe the bug
While running the test suite, there are some flaky tests with the comments shared example. I've seen it on Accountability and Budgets at least.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
That this spec should run green all the time
Screenshots

Stacktrace
Randomized with seed 45779 F Failures: 1) Accountability result comments when authenticated when user adds a new comment shows comment to the user, updates the comments counter and clears the comment textarea Failure/Error: DEFAULT_FAILURE_NOTIFIER = lambda { |failure, _opts| raise failure } expected to find visible css "span.comments-count" with text "4 COMMENTS" but there were no matches. Also found "3 COMMENTS", which matched the selector but not all filters. [Screenshot Image]: file:///home/apereira/Work/decidim/decidim/spec/decidim_dummy_app/tmp/screenshots/failures_r_spec_example_groups_accountability_result_comments_when_authenticated_when_user_adds_a_new_comment_shows_comment_to_the_user__updates_the_comments_counter_and_clears_the_comment_textarea_673.png [Screenshot HTML]: file:///home/apereira/Work/decidim/decidim/spec/decidim_dummy_app/tmp/screenshots/failures_r_spec_example_groups_accountability_result_comments_when_authenticated_when_user_adds_a_new_comment_shows_comment_to_the_user__updates_the_comments_counter_and_clears_the_comment_textarea_673.html Shared Example Group: "comments" called from ./spec/system/comments_spec.rb:11 # /home/apereira/Work/decidim/decidim/decidim-core/lib/decidim/core/test/shared_examples/comments_examples.rb:378:in `block (4 levels) in <top (required)>' Finished in 16.16 seconds (files took 5.33 seconds to load) 1 example, 1 failure Failed examples: rspec ./spec/system/comments_spec.rb[1:5:4:1] # Accountability result comments when authenticated when user adds a new comment shows comment to the user, updates the comments counter and clears the comment textarea Randomized with seed 45779Extra data (please complete the following information):
Additional context
https://github.com/decidim/decidim/runs/7070353790?check_suite_focus=true