Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix a flaky system test (#33778)

Alan Guo Xiang Tan2c0635ee4c49
diff --git a/spec/system/s3_secure_uploads_spec.rb b/spec/system/s3_secure_uploads_spec.rb
index 48d503f1902..547d7605732 100644
--- a/spec/system/s3_secure_uploads_spec.rb
+++ b/spec/system/s3_secure_uploads_spec.rb
@@ -18,8 +18,11 @@ describe "Uploading files in the composer to S3", type: :system do
def expect_first_post_to_have_secure_upload
img = first_post_img
expect(img["src"]).to include("/secure-uploads")
- topic = topic_page.current_topic
- expect(topic.first_post.uploads.first.secure).to eq(true)
+
+ try_until_success do
+ topic = topic_page.current_topic
+ expect(topic.first_post.uploads.first.secure).to eq(true)
+ end
end
it "marks uploads inside of private message posts as secure" do