Skip to content

Fix flaky file tree sidebar test

Stanislav Lashmanov requested to merge slashmanov/fix-flaky-file-tree-test into master

What does this MR do and why?

Fixes Flaky test: spec/features/merge_request/user_se... (#432665 - closed) (quarantine MR: Test: quarantine flaky user_sees_merge_request_... (!137617 - closed)).

Explanation:

We've changed recently how the scroll behaves when you're going through files in file-by-file mode. This affected this test in a sense that file browser height had to be updated once you've clicked the Next button because previously there was no change to the viewport scroll position but now there is. When we scroll a bit into the diffs area the file browser sidebar has to update its height to reflect on the empty space. This is where the test gets flaky because this logic is both async and debounced twice. I'll add an MR that waits a bit before doing the assertions so that the layout has already stabilised.

How to set up and validate locally

  1. Run rspec ./spec/features/merge_request/user_sees_merge_request_file_tree_sidebar_spec.rb
  2. Ensure the test passes
Edited by Stanislav Lashmanov

Merge request reports