MUX: Prevent goroutine leak (#5110)

This commit is contained in:
patterniha
2025-09-10 02:33:19 +02:00
committed by GitHub
parent ce5c51d3ba
commit 9f5dcb1591
7 changed files with 109 additions and 33 deletions

View File

@@ -41,11 +41,11 @@ func TestSessionManagerClose(t *testing.T) {
m := NewSessionManager()
s := m.Allocate(&ClientStrategy{})
if m.CloseIfNoSession() {
if m.CloseIfNoSessionAndIdle(m.Size(), m.Count()) {
t.Error("able to close")
}
m.Remove(false, s.ID)
if !m.CloseIfNoSession() {
if !m.CloseIfNoSessionAndIdle(m.Size(), m.Count()) {
t.Error("not able to close")
}
}