Skip to content

Commit

Permalink
failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcastano committed Jul 13, 2023
1 parent 0f9a9bd commit c84a84b
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/poolex_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,30 @@ defmodule PoolexTest do
end

describe "timeouts" do
test "handles fun timeouts" do
pool_name = start_pool(worker_module: SomeWorker, workers_count: 1)

delay = :timer.seconds(3)

assert {:ok, :some_result} =
Poolex.run(
pool_name,
fn pid -> GenServer.call(pid, {:do_some_work_with_delay, delay}) end,
timeout: 10
)

delay = :timer.seconds(6)

# FIXME
# assert {:runtime_error, :timeout} =
assert :all_workers_are_busy =
Poolex.run(
pool_name,
fn pid -> GenServer.call(pid, {:do_some_work_with_delay, delay}) end,
timeout: 10
)
end

test "when caller waits too long" do
pool_name = start_pool(worker_module: SomeWorker, workers_count: 1)

Expand Down

0 comments on commit c84a84b

Please sign in to comment.