From ed35ff0a7c2ecc440a13766c99158e6d68f7167b Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Tue, 3 Jan 2023 13:15:40 +1000 Subject: [PATCH] DEV: Remove Jobs.run_immediately! for all system specs See if this fixes the thread issues --- plugins/chat/spec/system/archive_channel_spec.rb | 4 ++-- plugins/chat/spec/system/channel_members_page_spec.rb | 2 +- plugins/chat/spec/system/jit_messages_spec.rb | 2 +- .../chat/spec/system/message_notifications_mobile_spec.rb | 2 +- .../spec/system/message_notifications_with_sidebar_spec.rb | 4 ++-- .../spec/system/user_menu_notifications/sidebar_spec.rb | 6 +++--- plugins/chat/spec/system/user_status/sidebar_spec.rb | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/chat/spec/system/archive_channel_spec.rb b/plugins/chat/spec/system/archive_channel_spec.rb index 3a180757e6..f4c8855219 100644 --- a/plugins/chat/spec/system/archive_channel_spec.rb +++ b/plugins/chat/spec/system/archive_channel_spec.rb @@ -53,7 +53,7 @@ RSpec.describe "Archive channel", type: :system, js: true do end context "when archiving" do - before { Jobs.run_immediately! } + # before { Jobs.run_immediately! } it "works" do chat.visit_channel_settings(channel_1) @@ -93,7 +93,7 @@ RSpec.describe "Archive channel", type: :system, js: true do context "when archiving failed" do before do - Jobs.run_immediately! + # Jobs.run_immediately! channel_1.update!(status: :read_only) end diff --git a/plugins/chat/spec/system/channel_members_page_spec.rb b/plugins/chat/spec/system/channel_members_page_spec.rb index 166c45612c..21694eb3c7 100644 --- a/plugins/chat/spec/system/channel_members_page_spec.rb +++ b/plugins/chat/spec/system/channel_members_page_spec.rb @@ -39,7 +39,7 @@ RSpec.describe "Channel - Info - Members page", type: :system, js: true do 98.times { channel_1.add(Fabricate(:user)) } channel_1.update!(user_count_stale: true) - Jobs.run_immediately! + # Jobs.run_immediately! Jobs::UpdateChannelUserCount.new.execute(chat_channel_id: channel_1.id) end diff --git a/plugins/chat/spec/system/jit_messages_spec.rb b/plugins/chat/spec/system/jit_messages_spec.rb index b922242712..aa90e95af7 100644 --- a/plugins/chat/spec/system/jit_messages_spec.rb +++ b/plugins/chat/spec/system/jit_messages_spec.rb @@ -9,7 +9,7 @@ RSpec.describe "JIT messages", type: :system, js: true do let(:channel) { PageObjects::Pages::ChatChannel.new } before do - Jobs.run_immediately! + # Jobs.run_immediately! channel_1.add(current_user) chat_system_bootstrap sign_in(current_user) diff --git a/plugins/chat/spec/system/message_notifications_mobile_spec.rb b/plugins/chat/spec/system/message_notifications_mobile_spec.rb index 40a099e25c..7422e89db8 100644 --- a/plugins/chat/spec/system/message_notifications_mobile_spec.rb +++ b/plugins/chat/spec/system/message_notifications_mobile_spec.rb @@ -48,7 +48,7 @@ RSpec.describe "Message notifications - mobile", type: :system, js: true, mobile context "when user is in DnD" do before do - Jobs.run_immediately! + # Jobs.run_immediately! Fabricate( :do_not_disturb_timing, user: current_user, diff --git a/plugins/chat/spec/system/message_notifications_with_sidebar_spec.rb b/plugins/chat/spec/system/message_notifications_with_sidebar_spec.rb index 380a331033..2a18344f1c 100644 --- a/plugins/chat/spec/system/message_notifications_with_sidebar_spec.rb +++ b/plugins/chat/spec/system/message_notifications_with_sidebar_spec.rb @@ -46,7 +46,7 @@ RSpec.describe "Message notifications - with sidebar", type: :system, js: true d context "when user is in DnD" do before do - Jobs.run_immediately! + # Jobs.run_immediately! Fabricate( :do_not_disturb_timing, user: current_user, @@ -89,7 +89,7 @@ RSpec.describe "Message notifications - with sidebar", type: :system, js: true d end context "when a message with mentions is created" do - before { Jobs.run_immediately! } + # before { Jobs.run_immediately! } it "correctly renders notifications" do visit("/") diff --git a/plugins/chat/spec/system/user_menu_notifications/sidebar_spec.rb b/plugins/chat/spec/system/user_menu_notifications/sidebar_spec.rb index a5d930049a..4eea1b0b0d 100644 --- a/plugins/chat/spec/system/user_menu_notifications/sidebar_spec.rb +++ b/plugins/chat/spec/system/user_menu_notifications/sidebar_spec.rb @@ -39,7 +39,7 @@ RSpec.describe "User menu notifications | sidebar", type: :system, js: true do context "when dm channel" do fab!(:dm_channel_1) { Fabricate(:direct_message_channel, users: [current_user, other_user]) } - before { Jobs.run_immediately! } + # before { Jobs.run_immediately! } context "when @username" do it "shows a mention notification" do @@ -71,7 +71,7 @@ RSpec.describe "User menu notifications | sidebar", type: :system, js: true do before do channel_1.add(current_user) channel_1.add(other_user) - Jobs.run_immediately! + # Jobs.run_immediately! end context "when group mention" do @@ -163,7 +163,7 @@ RSpec.describe "User menu notifications | sidebar", type: :system, js: true do fab!(:other_user) { Fabricate(:user) } before do - Jobs.run_immediately! + # Jobs.run_immediately! channel_1.add(current_user) end diff --git a/plugins/chat/spec/system/user_status/sidebar_spec.rb b/plugins/chat/spec/system/user_status/sidebar_spec.rb index e29a3d19b8..b83b078551 100644 --- a/plugins/chat/spec/system/user_status/sidebar_spec.rb +++ b/plugins/chat/spec/system/user_status/sidebar_spec.rb @@ -13,7 +13,7 @@ RSpec.describe "User status | sidebar", type: :system, js: true do chat_system_bootstrap current_user.set_status!("online", "heart") sign_in(current_user) - Jobs.run_immediately! + # Jobs.run_immediately! end it "shows user status" do