summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-09-08 07:08:44 -0400
committerStan Hu <stanhu@gmail.com>2016-09-08 18:52:54 -0400
commit26e4d00eac301bb50c89aedd858dbfc27f4688ed (patch)
tree52015f0dcbff81b1fa729ff2b47f1b9fcb7e3a13
parent22ee3f5452c4193b1e3da3efce44f871e75287d6 (diff)
downloadgitlab-ce-26e4d00eac301bb50c89aedd858dbfc27f4688ed.tar.gz
Use wait_for_ajax to avoid database deadlocks after specs are cleaned
-rw-r--r--spec/support/issuable_slash_commands_shared_examples.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/support/issuable_slash_commands_shared_examples.rb b/spec/support/issuable_slash_commands_shared_examples.rb
index a51742089d0..a3fbba55e27 100644
--- a/spec/support/issuable_slash_commands_shared_examples.rb
+++ b/spec/support/issuable_slash_commands_shared_examples.rb
@@ -2,6 +2,8 @@
# It takes a `issuable_type`, and expect an `issuable`.
shared_examples 'issuable record that supports slash commands in its description and notes' do |issuable_type|
+ include WaitForAjax
+
let(:master) { create(:user) }
let(:assignee) { create(:user, username: 'bob') }
let(:guest) { create(:user) }
@@ -18,6 +20,11 @@ shared_examples 'issuable record that supports slash commands in its description
login_with(master)
end
+ after do
+ # Ensure all outstanding Ajax requests are complete to avoid database deadlocks
+ wait_for_ajax
+ end
+
def write_note(text)
Sidekiq::Testing.fake! do
page.within('.js-main-target-form') do