Add flaky tags & retry in specs (#12750)
This commit is contained in:
parent
18129f2cb2
commit
60be1d6def
4 changed files with 7 additions and 3 deletions
|
|
@ -115,6 +115,10 @@ RSpec.configure do |config|
|
|||
allow(Search::Client).to receive(:index).and_return({ "_source" => {} })
|
||||
end
|
||||
|
||||
config.around(:each, :flaky) do |ex|
|
||||
ex.run_with_retry retry: 3
|
||||
end
|
||||
|
||||
config.around(:each, elasticsearch_reset: true) do |example|
|
||||
Search::Cluster.recreate_indexes
|
||||
example.run
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ RSpec.describe Articles::Suggest, type: :service do
|
|||
expect(described_class.call(article).size).to eq(4)
|
||||
end
|
||||
|
||||
it "returns proper number of articles with post with different tags" do
|
||||
it "returns proper number of articles with post with different tags", :flaky do
|
||||
create_list(:article, 2, featured: true, tags: ["discuss"], score: 10)
|
||||
create_list(:article, 2, featured: true, tags: ["javascript"])
|
||||
article = create(:article, featured: true, tags: ["discuss"])
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ RSpec.describe "Creating an article with the editor", type: :system do
|
|||
sign_in user
|
||||
end
|
||||
|
||||
it "creates a new article", js: true, retry: 3 do
|
||||
it "creates a new article", :flaky, js: true do
|
||||
visit new_path
|
||||
fill_in "article_body_markdown", with: template
|
||||
click_button "Save changes"
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ RSpec.describe "User visits podcast show page", type: :system, js: true do
|
|||
expect(result).to be false
|
||||
end
|
||||
|
||||
it "they see the content of the hero", js: true, retry: 3 do
|
||||
it "they see the content of the hero", :flaky, js: true do
|
||||
visit podcast_episode.path.to_s
|
||||
|
||||
expect(page).to have_text(podcast_episode.title)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue