Skip to content

Commit

Permalink
run requests concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ruoss committed Jan 18, 2023
1 parent a101b12 commit 33bdcdc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/k8s/client/runner/base_integration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,15 @@ defmodule K8s.Client.Runner.BaseIntegrationTest do
@tag :reliability
test "concurrent requests succeed", %{conn: conn} do
results =
Enum.map(0..100, fn _ ->
0..100
|> Task.async_stream(fn _ ->
K8s.Client.list("v1", "pod")
|> K8s.Operation.put_query_param(:limit, 100)
|> K8s.Client.put_conn(conn)
|> K8s.Client.run()
end)
|> Enum.to_list()

assert Enum.all?(results, &match?({:ok, %{}}, &1))
assert Enum.all?(results, &match?({:ok, {:ok, %{}}}, &1))
end
end

0 comments on commit 33bdcdc

Please sign in to comment.