diff --git a/bench/insert.exs b/bench/insert.exs index 7c38b36..a8baa60 100644 --- a/bench/insert.exs +++ b/bench/insert.exs @@ -43,12 +43,16 @@ Benchee.run( |> Stream.run() end, "insert stream" => fn rows -> - DBConnection.run(conn, fn conn -> - rows - |> Stream.chunk_every(60_000) - |> Stream.map(fn chunk -> RowBinary.encode_rows(chunk, types) end) - |> Enum.into(Ch.stream(conn, statement)) - end) + DBConnection.run( + conn, + fn conn -> + rows + |> Stream.chunk_every(60_000) + |> Stream.map(fn chunk -> RowBinary.encode_rows(chunk, types) end) + |> Enum.into(Ch.stream(conn, statement)) + end, + timeout: :infinity + ) end }, inputs: %{ diff --git a/bench/stream.exs b/bench/stream.exs index 85ba295..5c3f140 100644 --- a/bench/stream.exs +++ b/bench/stream.exs @@ -24,16 +24,20 @@ Benchee.run( ) end, "RowBinary stream with manual decode" => fn statement -> - DBConnection.run(conn, fn conn -> - conn - |> Ch.stream(statement, _params = [], format: "RowBinary") - |> Stream.map(fn %Ch.Result{data: data} -> - data - |> IO.iodata_to_binary() - |> Ch.RowBinary.decode_rows([:u64]) - end) - |> Stream.run() - end) + DBConnection.run( + conn, + fn conn -> + conn + |> Ch.stream(statement, _params = [], format: "RowBinary") + |> Stream.map(fn %Ch.Result{data: data} -> + data + |> IO.iodata_to_binary() + |> Ch.RowBinary.decode_rows([:u64]) + end) + |> Stream.run() + end, + timeout: :infinity + ) end }, inputs: %{