Commit 26e4d00e authored by Stan Hu's avatar Stan Hu

Use wait_for_ajax to avoid database deadlocks after specs are cleaned

parent 22ee3f54
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment