Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions test/quantum/job_broadcaster_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,21 @@ defmodule Quantum.JobBroadcasterTest do
assert_receive %{test_id: ^test_id}
end

@tag jobs: :active, listen_storage: true, storage: :with_update
test "active => inactive with updating storage", %{
broadcaster: broadcaster,
active_job: active_job
} do
active_job_name = active_job.name

capture_log(fn ->
TestScheduler.deactivate_job(broadcaster, active_job_name)

assert_receive {:received, {:remove, ^active_job_name}}
assert_receive {:update_job_state, {^active_job_name, :inactive}, _}
end)
end

@tag jobs: :inactive, listen_storage: true
test "inactive => active", %{broadcaster: broadcaster, inactive_job: inactive_job} do
test_id = "update-inactive-to-active-job-handler"
Expand Down
2 changes: 1 addition & 1 deletion test/support/test_storage.ex
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ defmodule Quantum.Storage.Test do

@impl Quantum.Storage
def update_job_state(_storage_pid, job_name, state),
do: send_and_wait(:update_job_state, job_name, state)
do: send_and_wait(:update_job_state, {job_name, state})

@impl Quantum.Storage
def last_execution_date(_storage_pid),
Expand Down