From 816b5f70196486e693dd0a3ce59f9dde7ba558db Mon Sep 17 00:00:00 2001
From: Jakub Witczak <kuba@erlang.org>
Date: Wed, 7 May 2025 16:58:27 +0200
Subject: [PATCH] ssh: ssh_test_lib add extra remove_handler to improve
 robustness in tests

---
 lib/ssh/test/ssh_test_lib.erl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl
index 96b4f10392f1..210944cdb1f8 100644
--- a/lib/ssh/test/ssh_test_lib.erl
+++ b/lib/ssh/test/ssh_test_lib.erl
@@ -1324,6 +1324,7 @@ set_log_level(Level) ->
     ok = logger:set_primary_config(level, Level).
 
 add_log_handler() ->
+    logger:remove_handler(?MODULE),
     TestRef = make_ref(),
     ok = logger:add_handler(?MODULE, ?MODULE,
                             #{level => debug,
