Flaky spec: user_suggests_changes_on_diff_spec - suggestion apply tests fail due to timing issue
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Summary
Two tests in spec/features/merge_request/user_suggests_changes_on_diff_spec.rb fail consistently on CI:
User comments on a diff single suggestion note suggestion is appliable(line 94)User comments on a diff multi-line suggestions resolves discussion when applied(line 400)
Both fail with a 30s Capybara timeout waiting for "Applied" / "Reopen thread" after clicking "Apply suggestion". The suggestion apply action never completes from the test's perspective.
Root cause
The spec relies on wait_for_requests being called automatically after visit (via spec/support/capybara_wait_for_requests.rb) to ensure the diff is fully loaded before the test interacts with it. After the paneled view cleanup in e86b3c5c ("Cleanup merge request diff helpers"), the timing became more sensitive and the auto-wait is no longer reliably sufficient.
The failures are not flaky - they reproduce consistently on every run and retry.
Fix in progress
- !238700 (closed) - "Only auto-wait after visit for allowlisted suites" addresses the broader
wait_for_requestsreliability issue.user_suggests_changes_on_diff_spec.rbis already in its allowlist.
References
- Job: https://gitlab.com/gitlab-org/gitlab/-/jobs/14643923740
- Related cleanup commit: e86b3c5c
- Fix MR: !238700 (closed)