[bug] ExUnit: restarting logger with capture_log: true stops current test execution without errors

39 views
Skip to first unread message

Daniel Kukuła

unread,
Jan 28, 2023, 5:40:01 AM1/28/23
to elixir-lang-core
I recently found a bug that shows up when you have capture_log enabled and your code uses Logger.App.stop()/start(). Having capture_log: true makes this test show up green.
```
  @tag capture_log: true
  test "greets the world" do
    Logger.App.stop()
    Logger.App.start()
    assert :hello == :world
  end
```
Minimal example repo here with capture_log set in ExUnit.start(capture_log: true)
https://github.com/dkuku/logger_error

José Valim

unread,
Jan 28, 2023, 6:13:32 AM1/28/23
to elixir-l...@googlegroups.com
Thank you, fixed in main.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/6924e867-c9ff-4dcb-b8ea-571f6cc2e156n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages