Skip to content

Commit

Permalink
Fix flaky translator test (#91)
Browse files Browse the repository at this point in the history
The test introduced in #90 has a typo and doesn't delete the added env.

Hence when the added case runs prior to the preexisting one,
the test suite inevitably fails.

Validated by running;

```
mix test test/plug/cowboy/translator_test.exs --trace --seed 899179
```
  • Loading branch information
sato11 authored Jan 13, 2023
1 parent 425f7c8 commit 1796e77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/plug/cowboy/translator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ defmodule Plug.Cowboy.TranslatorTest do
test "metadata opt-out ranch/cowboy 500 logs" do
{:ok, _pid} = Plug.Cowboy.http(__MODULE__, [], port: 9004)
Application.put_env(:plug_cowboy, :conn_in_exception_metadata, false)
on_exit(fn -> Application.delete_env(:plug_cowboy, :log_exceptions_with_status_code) end)
on_exit(fn -> Application.delete_env(:plug_cowboy, :conn_in_exception_metadata) end)

metadata =
capture_log(@metadata_log_opts, fn ->
Expand Down

0 comments on commit 1796e77

Please sign in to comment.