Merge pull request #3552 from nspcc-dev/fix-wsclient-limit

rpcsrv: fix failing TestWSClientsLimit
This commit is contained in:
Anna Shaleva 2024-08-09 16:44:27 +03:00 committed by GitHub
commit 79e78980c4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -590,11 +590,9 @@ func doSomeWSRequest(t *testing.T, ws *websocket.Conn) {
} }
func TestWSClientsLimit(t *testing.T) { func TestWSClientsLimit(t *testing.T) {
for tname, limit := range map[string]int{"default": 0, "8": 8, "disabled": -1} { for tname, limit := range map[string]int{"8": 8, "disabled": -1} {
effectiveClients := limit effectiveClients := limit
if limit == 0 { if limit < 0 {
effectiveClients = defaultMaxWebSocketClients
} else if limit < 0 {
effectiveClients = 0 effectiveClients = 0
} }
t.Run(tname, func(t *testing.T) { t.Run(tname, func(t *testing.T) {