We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
{{:badmatch, {:error, :eaddrinuse}}, [ {Bypass.Instance, :do_up, 2, [file: 'lib/bypass/instance.ex', line: 322]}, {Bypass.Instance, :init, 1, [file: 'lib/bypass/instance.ex', line: 34]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]} ]}
The race condition could be reproduced with the following script
defmodule BypassReproTest.Case do use ExUnit.Case, async: true test "reproduce bypass" do :ok = :hackney_pool.start_pool(:first_pool, timeout: 15000, max_connections: 100) Application.put_env(:bypass, :test_framework, :espec) 1..10_000 |> Task.async_stream( fn i -> bypass = Bypass.open() Bypass.stub(bypass, "GET", "/ping", fn conn -> Plug.Conn.resp(conn, 200, "pong") end) response = HTTPoison.get!("http://localhost:#{bypass.port}/ping", [], hackney: [pool: :bypass]) assert response.status_code == 200 Bypass.verify_expectations!(bypass) end, ordered: false, max_concurrency: 50, timeout: 50000 ) |> Stream.run() end end
The Code.ensure_loaded should be commented out as well.
if Code.ensure_loaded?(ESpec) do defp verify_expectations!(:espec, bypass) do do_verify_expectations(bypass.pid, ESpec.AssertionError) end end
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The race condition could be reproduced with the following script
The Code.ensure_loaded should be commented out as well.
The text was updated successfully, but these errors were encountered: