Skip to content

Commit

Permalink
Adjust LV test sleep time
Browse files Browse the repository at this point in the history
  • Loading branch information
wmnnd committed Aug 11, 2024
1 parent 2f9b9fc commit ece9bc2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions test/keila/mailings/mailings_campaign_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ defmodule Keila.MailingsCampaignTest do

assert :ok = Mailings.deliver_campaign(campaign.id)

Oban.drain_queue(queue: :periodic)
assert %{success: 1} = Oban.drain_queue(queue: :periodic)
assert %{success: ^n, failure: 0} = Oban.drain_queue(queue: :mailer, with_scheduled: true)

for _ <- 1..n do
Expand Down Expand Up @@ -122,7 +122,7 @@ defmodule Keila.MailingsCampaignTest do

assert :ok = Mailings.deliver_campaign(campaign.id)

Oban.drain_queue(queue: :periodic)
assert %{success: 1} = Oban.drain_queue(queue: :periodic)

assert %{success: ^n_expected_sent, failure: 0, snoozed: ^n_expected_snoozed} =
Oban.drain_queue(queue: :mailer, with_scheduled: true)
Expand Down Expand Up @@ -161,7 +161,7 @@ defmodule Keila.MailingsCampaignTest do

assert :ok = Mailings.deliver_campaign(campaign.id)

Oban.drain_queue(queue: :periodic)
assert %{success: 1} = Oban.drain_queue(queue: :periodic)
assert %{success: ^n, failure: 0} = Oban.drain_queue(queue: :mailer, with_scheduled: true)

for _ <- 1..n do
Expand All @@ -186,7 +186,7 @@ defmodule Keila.MailingsCampaignTest do

assert :ok = Mailings.deliver_campaign(campaign.id)

Oban.drain_queue(queue: :periodic)
assert %{success: 1} = Oban.drain_queue(queue: :periodic)
assert %{success: ^n, failure: 0} = Oban.drain_queue(queue: :mailer, with_scheduled: true)

for _ <- 1..n do
Expand Down Expand Up @@ -308,7 +308,7 @@ defmodule Keila.MailingsCampaignTest do
)

assert :ok = Mailings.deliver_campaign(campaign.id)
Oban.drain_queue(queue: :periodic)
assert %{success: 1} = Oban.drain_queue(queue: :periodic)
assert %{success: 1, failure: 0} = Oban.drain_queue(queue: :mailer, with_scheduled: true)

receive do
Expand Down Expand Up @@ -343,7 +343,7 @@ defmodule Keila.MailingsCampaignTest do

assert :ok = Mailings.deliver_campaign(campaign.id)

Oban.drain_queue(queue: :periodic)
assert %{success: 1} = Oban.drain_queue(queue: :periodic)
assert %{success: 1, cancelled: 1} = Oban.drain_queue(queue: :mailer, with_scheduled: true)
assert %{status: :sent} = Mailings.get_campaign_stats(campaign.id)
end
Expand Down
2 changes: 1 addition & 1 deletion test/keila_web/controllers/campaign_controller_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ defmodule KeilaWeb.CampaignControllerTest do

Oban.drain_queue(queue: :periodic)
Oban.drain_queue(queue: :mailer, with_scheduled: true)
:timer.sleep(500)
:timer.sleep(1500)

assert render(lv) =~
"<div class=\"text-sm\">emails sent</div><div class=\"text-3xl\">10</div>"
Expand Down

0 comments on commit ece9bc2

Please sign in to comment.