Fix flaky transfer project and quick_action_suggestions frame-guard specs
What does this MR do and why?
This backports two test-only fixes to 19-0-stable-ee.
First, it backports the spec fix from !239015 (merged). That fix addresses a flaky test in spec/features/projects/settings/user_transfers_a_project_spec.rb, specifically the example "allows transferring a project to a group". The test was reading the database before the project-transfer request had completed on the server, causing the assertion to fail intermittently. The fix waits for the post-transfer page redirect to complete before querying the database, which ensures the request has finished before checking the results. It also removes now-unneeded wait calls and excludes the file from linting rules that flag such waits.
Second, it backports the spec fix from !242910 (merged), which fixes a flaky test in spec/frontend/editor/quick_action_suggestions_spec.js, the example "guards against double increment in the same frame". The test tried to mock global.performance, but in jsdom that property is read-only, so the mock had no effect and the code kept reading the real advancing clock. When two consecutive calls crossed a 16 millisecond frame boundary, the deduplication guard missed and the storage write happened twice, failing intermittently. The fix spies on performance.now instead, pinning the frame boundary and making the guard deterministic.
Both fixes are already present in master. This second fix is also backported to 19-1-stable-ee in !249389 (merged). Neither change touches product code.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
- This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
- The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
- The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
- Required labels have been applied to this merge request
- severity label and bug subtype labels (if applicable)
- If this MR fixes a bug that affects customers, the customer label has been applied.
- This MR has been approved by a maintainer (only one approval is required).
- Ensure the
e2e:test-on-omnibus-eejob has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.
Note to the merge request author and maintainer
If you have questions about the patch release process, please:
- Refer to the patch release runbook for engineers and maintainers for guidance.
- Ask questions on the
#releasesSlack channel (internal only). - Once the backport has been merged, the commit changes will be automatically deployed to a release environment that can be used for manual validation. See after merging runbook for details.