diegogl12

diegogl12

Hard time with bypass and multiple ports

Using bypass for several different ports, but only one is not working

I set up a bypass for three different url ports (10000, 11000, 12000). When running the specific test case, the test always passes, but running all tests, the bypass returns 500 status intermittently but only for port 10000.

  setup do
    %{bypass: bypass_11000} = setup_11000()
    %{bypass: bypass_10000} = setup_10000()

    %{
      bypass_11000: bypass_11000,
      bypass_10000: bypass_10000
    }
  end

  defp setup_11000() do
    config = Application.get_env(:app, :config_11000)

    %{port: port_11000} =
      config
      |> Keyword.get(:url)
      |> URI.parse()

    port_11000 = Bypass.open(port: port_11000)

    %{bypass: port_11000}
  end

  defp setup_10000() do
    config = Application.get_env(:app, :config_10000)

    %{port: port_10000} =
      config
      |> Keyword.get(:url)
      |> URI.parse()

    port_10000 = Bypass.open(port: port_10000)

    %{bypass: port_10000}
  end

Tried to log inside the bypass and I figured out that the cases that return 500 are never even logging. I’m assuming that it is crashing even before getting inside the bypass.

Any thoughts on how to debug bypass during tests?

Where Next?

Popular in Questions Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
RisingFromAshes
I’ve read in another post that it may be possible with a router helper - but I couldn’t find an appropriate one, and tbh, I’m still just ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Lily
In templates/appointment/index.html.eex: <%= for appointment <- @appointments do %> <tr> <td><%= appoi...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
lanycrost
Hi everyone! I need implement if…else if…else condition from my elixir code, and anymore of this control flow structures not work proper...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 40165 209
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
985 44778 311
New

We're in Beta

About us Mission Statement