add test for default timeout
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
ci/woodpecker/pr/woodpecker Pipeline was successful

This commit is contained in:
FloatingGhost 2022-11-14 14:55:11 +00:00
parent 6f888f025e
commit 3f76a646c1

View file

@ -37,4 +37,16 @@ test "Creates are normal priority", %{post: post} do
assert {:ok, %Oban.Job{priority: 0}} = Federator.publish(post) assert {:ok, %Oban.Job{priority: 0}} = Federator.publish(post)
end end
end end
describe "Oban job timeout" do
test "should have a timeout" do
clear_config([:workers, :timeout, :federator_outgoing], :timer.minutes(2))
assert Pleroma.Workers.PublisherWorker.timeout(nil) == :timer.minutes(2)
end
test "should use a default timeout if none specified" do
clear_config([:workers, :timeout, :federator_outgoing])
assert Pleroma.Workers.PublisherWorker.timeout(nil) == :timer.seconds(10)
end
end
end end