fix transient failure in path_locks_spec.rb
What does this MR do?
wait for Lock request to be finished before navigating away from that page
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
this failed a few times on 9-5-stable-ee
Testing
Added artificial delay to Lock button, and ran test a bunch of times
for i in `seq 20` ; do bin/rspec spec/features/projects/path_locks_spec.rb ; [[ ! $? = 0 ]] && break ; done
diff --git a/app/assets/javascripts/path_locks.js b/app/assets/javascripts/path_locks.js
index 8b22b412f14..a074b4764ff 100644
--- a/app/assets/javascripts/path_locks.js
+++ b/app/assets/javascripts/path_locks.js
@@ -11,11 +11,13 @@
$lockBtn = $(this);
currentState = $lockBtn.data('state');
toggleAction = currentState === 'lock' ? 'unlock' : 'lock';
- return $.post(url, {
- path: path
- }, function() {
- location.reload();
- });
+ setTimeout(() => {
+ return $.post(url, {
+ path: path
+ }, function() {
+ location.reload();
+ });
+ }, 4500);
});
};
Does this MR meet the acceptance criteria?
-
Changelog entry added, if necessary -
Documentation created/updated -
API support added -
Tests added for this feature/bug - Review
-
Has been reviewed by UX -
Has been reviewed by Frontend -
Has been reviewed by Backend -
Has been reviewed by Database
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Squashed related commits together