If I launched an instance of my phoenix application and typed it with requests, my plugins would stop accordingly. However, doing the same if the test environment stops does not stop the downstream plug-ins, which leads to the failure of my tests. I think that the problem may arise due to the fact that I call the router during my test. Here we use an auxiliary function, which is heavily borrowed from a similar function in the phoenix system itself:
def call(router, verb, path, params \\ nil, headers \\ []) do
add_headers(conn(verb, path, params), headers)
|> Plug.Conn.fetch_params
|> Plug.Parsers.call(parsers: [Plug.Parsers.JSON],
pass: ["*/*"],
json_decoder: Poison)
|> router.call(router.init([]))
end
Any ideas on why calling my router like this leads to a shutdown?
EDIT: So, I am upgrading to Phoenix 0.13.1 to use the new endpoint testing module instead of what I used. I will talk about whether this fixes the problem or not.
source
share