You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running tests I am intermittently getting this error:
12:06:12.384 [error] Process #PID<0.1286.0> raised an exception
** (CaseClauseError) no case clause matching: <payload_here>
(cowboy) /Users/elbow-jason/my_app/deps/cowboy/src/cowboy_protocol.erl:344: :cowboy_protocol.parse_hd_value/9
12:06:12.389 [error] Ranch protocol #PID<0.1286.0> (:cowboy_protocol) of listener #Reference<0.1060090579.823656453.233967> terminated
** (exit) an exception was raised:
** (CaseClauseError) no case clause matching: <payload_here>
(cowboy) /Users/elbow-jason/my_app/deps/cowboy/src/cowboy_protocol.erl:344: :cowboy_protocol.parse_hd_value/9
with a failing test that says:
1) test client can post! and handle the response (MyApp.NotifierClientTest)
test/my_app/notifier_client_test.exs:12
** (HTTPoison.Error) :closed
code: assert ^payload = NotifierClient.post!(endpoint_url(bypass.port), %{"hello" => "world"})
stacktrace:
(httpoison) lib/httpoison.ex:66: HTTPoison.request!/5
(my_app) lib/my_app/notifier_client.ex:10: MyApp.NotifierClient.post!/2
test/my_app/notifier_client_test.exs:18: (test)
here is the source:
setupdobypass=Bypass.open{:ok,bypass: bypass}endtest"client can post! and handle the response",%{bypass: bypass}dopayload=%{"errors"=>[%{"code"=>88,"message"=>"Rate limit exceeded"}]}Bypass.expect_oncebypass,"POST","/",fnconn->body=Poison.encode!(payload)Plug.Conn.resp(conn,200,body)endassert^payload=NotifierClient.post!(endpoint_url(bypass.port),%{"hello"=>"world"})enddefpendpoint_url(port),do: "http://localhost:#{port}/"
If I put a timer.sleep(100) in the setup block it stops happening.
Any suggestions/ideas for a solution?
The text was updated successfully, but these errors were encountered:
When running tests I am intermittently getting this error:
with a failing test that says:
here is the source:
If I put a
timer.sleep(100)
in thesetup
block it stops happening.Any suggestions/ideas for a solution?
The text was updated successfully, but these errors were encountered: