DEV: Skip flaky topic map spec on CI (#28159)

This commit is contained in:
Martin Brennan 2024-07-31 13:04:05 +10:00 committed by GitHub
parent 5830f2c9a1
commit 78f8b7ba99
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 21 additions and 14 deletions

View File

@ -171,7 +171,7 @@ RSpec.describe "Navigation", type: :system do
context "when opening a thread from the thread list" do
xit "goes back to the thread list when clicking the back button" do
skip("Flaky on CI") if ENV["CI"]
skip_on_ci!
visit("/chat")
chat_page.visit_channel(category_channel)
@ -187,7 +187,7 @@ RSpec.describe "Navigation", type: :system do
context "for mobile" do
it "goes back to the thread list when clicking the back button", mobile: true do
skip("Flaky on CI") if ENV["CI"]
skip_on_ci!
visit("/chat")
chat_page.visit_channel(category_channel)
@ -207,7 +207,7 @@ RSpec.describe "Navigation", type: :system do
before { Fabricate(:chat_message, thread: thread_2, use_service: true) }
it "goes back to the thread list when clicking the back button", mobile: true do
skip("Flaky on CI") if ENV["CI"]
skip_on_ci!
chat_page.visit_channel(category_channel)
channel_page.message_thread_indicator(thread.original_message).click
@ -227,7 +227,7 @@ RSpec.describe "Navigation", type: :system do
context "when opening a thread from indicator" do
it "goes back to the thread list when clicking the back button" do
skip("Flaky on CI") if ENV["CI"]
skip_on_ci!
visit("/chat")
chat_page.visit_channel(category_channel)
@ -242,7 +242,7 @@ RSpec.describe "Navigation", type: :system do
context "for mobile" do
it "closes the thread and goes back to the channel when clicking the back button",
mobile: true do
skip("Flaky on CI") if ENV["CI"]
skip_on_ci!
visit("/chat")
chat_page.visit_channel(category_channel)

View File

@ -83,7 +83,7 @@ describe "Uploading files in chat messages", type: :system do
end
it "allows uploading multiple files" do
skip("This test is flaky on CI") if ENV["CI"]
skip_on_ci!
chat.visit_channel(channel_1)
@ -108,7 +108,7 @@ describe "Uploading files in chat messages", type: :system do
end
it "allows uploading a huge image file with preprocessing" do
skip("This test is flaky on CI") if ENV["CI"]
skip_on_ci!
SiteSetting.composer_media_optimization_image_bytes_optimization_threshold = 200.kilobytes
chat.visit_channel(channel_1)

View File

@ -157,4 +157,8 @@ module SystemHelpers
)
end
end
def skip_on_ci!(message = "Flaky on CI")
skip(message) if ENV["CI"]
end
end

View File

@ -4,7 +4,7 @@ RSpec.describe "Network Disconnected", type: :system do
let(:cdp) { PageObjects::CDP.new }
it "NetworkConnectivity service adds class to DOM and displays offline indicator" do
skip(<<~TEXT) if ENV["CI"]
skip_on_ci!(<<~TEXT)
In CI this test will randomly flake - timing issue with the offline indicator
not being rendered soon enough after network conditions change
TEXT

View File

@ -39,6 +39,10 @@ describe "Topic Map - Private Message", type: :system do
end
it "updates the various topic stats, avatars" do
skip_on_ci!(
"This is flaky because it relies a lot on messagebus events and the counts don't always update in time",
)
freeze_time
sign_in(user)
topic_page.visit_topic(topic)
@ -77,12 +81,11 @@ describe "Topic Map - Private Message", type: :system do
expect(expanded_avatars.length).to eq 7
# views count
# TODO (martin) Investigate flakiness
# sign_in(other_user)
# topic_page.visit_topic(topic)
# try_until_success { expect(TopicViewItem.count).to eq(2) }
# page.refresh
# expect(topic_map.views_count).to eq(2)
sign_in(other_user_1)
topic_page.visit_topic(topic)
try_until_success { expect(TopicViewItem.count).to eq(2) }
page.refresh
expect(topic_map.views_count).to eq(2)
# likes count
expect(topic_map).to have_no_likes